mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Merge branch 'PHP-7.4'
This commit is contained in:
commit
527dad600b
@ -2272,6 +2272,7 @@ static HashTable *date_object_get_properties_for(zend_object *object, zend_prop_
|
||||
case ZEND_PROP_PURPOSE_SERIALIZE:
|
||||
case ZEND_PROP_PURPOSE_VAR_EXPORT:
|
||||
case ZEND_PROP_PURPOSE_JSON:
|
||||
case ZEND_PROP_PURPOSE_ARRAY_CAST:
|
||||
break;
|
||||
default:
|
||||
return zend_std_get_properties_for(object, purpose);
|
||||
@ -2393,6 +2394,7 @@ static HashTable *date_object_get_properties_for_timezone(zend_object *object, z
|
||||
case ZEND_PROP_PURPOSE_SERIALIZE:
|
||||
case ZEND_PROP_PURPOSE_VAR_EXPORT:
|
||||
case ZEND_PROP_PURPOSE_JSON:
|
||||
case ZEND_PROP_PURPOSE_ARRAY_CAST:
|
||||
break;
|
||||
default:
|
||||
return zend_std_get_properties_for(object, purpose);
|
||||
|
24
ext/date/tests/bug78383.phpt
Normal file
24
ext/date/tests/bug78383.phpt
Normal file
@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #78383: Casting a DateTime to array no longer returns its properties
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump((array) new DateTime('2000-01-01'));
|
||||
var_dump((array) new DateTimeZone('Europe/Berlin'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
["date"]=>
|
||||
string(26) "2000-01-01 00:00:00.000000"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
array(2) {
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(13) "Europe/Berlin"
|
||||
}
|
Loading…
Reference in New Issue
Block a user