Bug #78383 [NEW]: Casting a \Datetime to array no longer returns it properties

From: Date: Wed, 07 Aug 2019 13:03:08 +0000
Subject: Bug #78383 [NEW]: Casting a \Datetime to array no longer returns it properties
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222121@lists.php.net to get a copy of this message
From: jeremy at derusse dot com Operating system: Linux PHP version: 7.4.0beta1 Package: Date/time related Bug Type: Bug Bug description:Casting a \Datetime to array no longer returns it properties Description: ------------ Casting an instance of \Datetime to an array should return date's properties. Since PHP 7.4, the array is empty. see https://3v4l.org/epBRn Test script: --------------- var_dump((array) new \Datetime('2000-01-01')); Expected result: ---------------- array(3) { ["date"]=> string(26) "2000-01-01 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Actual result: -------------- array(0) { } -- Edit bug report at https://bugs.php.net/bug.php?id=78383&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78383&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78383&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78383&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78383&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78383&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78383&r=support Expected behavior: https://bugs.php.net/fix.php?id=78383&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78383&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78383&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78383&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78383&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78383&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78383&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78383&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78383&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78383&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78383&r=mysqlcfg

« previous php.bugs (#222121) next »