|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.4.0beta3
+- Date:
+ . Fixed bug #78383 (Casting a DateTime to array no longer returns its
+ properties). (Nikita)
08 Aug 2019, PHP 7.4.0beta2
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);
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);
--- /dev/null
+--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"
+}