Skip to content

Commit 0e7bf92

Browse files
committed
Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master: restore correct behavior of DateTime fix test use invalid code Fixed startup segfault in non-debug builds Fixes issue #87 PHP 5.4/5.5 compability in phpdbg_watch.c fix gcov data with some locales (again) Conflicts: ext/date/php_date.c
2 parents df07944 + e160976 commit 0e7bf92

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

ext/date/php_date.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,9 @@ PHP_METHOD(DateTime, __construct)
27182718

27192719
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
27202720
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|SO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
2721-
php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
2721+
if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
2722+
ZVAL_NULL(getThis());
2723+
}
27222724
}
27232725
zend_restore_error_handling(&error_handling TSRMLS_CC);
27242726
}

ext/date/tests/bug67118.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ class mydt extends datetime
2323
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
2424
?>
2525
--EXPECTF--
26-
Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %sbug67118.php on line %d
27-
Bad date
26+
Fatal error: Call to a member function format() on a non-object in %sbug67118.php on line %d

ext/date/tests/bug67118_2.phpt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Regression introduce in fix for Bug #67118
2+
Regression introduce in fix for Bug #67118 - Invalid code
33
--INI--
44
date.timezone=Europe/Paris
55
--FILE--
@@ -24,12 +24,5 @@ Done
2424
--EXPECTF--
2525
First try
2626
Second try
27-
object(Foo)#1 (3) {
28-
["date"]=>
29-
string(%d) "2007-09-12 15:49:%s"
30-
["timezone_type"]=>
31-
int(3)
32-
["timezone"]=>
33-
string(3) "UTC"
34-
}
35-
Done
27+
NULL
28+
Done

0 commit comments

Comments
 (0)