diff options
author | Remi Collet <remi@php.net> | 2014-06-05 14:04:44 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2014-06-05 14:04:44 +0200 |
commit | f11f7f56013c5ee4e6009997602e9b5a64064909 (patch) | |
tree | edd704febb4e1386625e7bb0415c3ad834966fa3 /ext/date/php_date.c | |
parent | f1ef7018f036de3b0d149ea0bc4575767b9bb413 (diff) | |
download | php-git-f11f7f56013c5ee4e6009997602e9b5a64064909.tar.gz |
restore correct behavior of DateTime
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 1809d6653b..700929154c 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2731,7 +2731,9 @@ PHP_METHOD(DateTime, __construct) zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { - php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC); + if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) { + ZVAL_NULL(getThis()); + } } zend_restore_error_handling(&error_handling TSRMLS_CC); } |