3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foobar implements \Serializable { /** @return string */ public function serialize(): string { return serialize(new \DateTimeZone('Europe/Andorra')); } /** @param string $serialized */ public function unserialize($serialized) { var_dump($serialized); var_dump(unserialize($serialized)->getName()); } } (new Foobar())->unserialize((new Foobar())->serialize()); var_dump(unserialize(serialize(new Foobar())));
Output for git.master, git.master_jit
Deprecated: Foobar implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/QEdfQ on line 3 string(86) "O:12:"DateTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:14:"Europe/Andorra";}" string(14) "Europe/Andorra" string(86) "O:12:"DateTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:14:"Europe/Andorra";}" Fatal error: Uncaught Error: The DateTimeZone object has not been correctly initialized by its constructor in /in/QEdfQ:15 Stack trace: #0 /in/QEdfQ(15): DateTimeZone->getName() #1 [internal function]: Foobar->unserialize('O:12:"DateTimeZ...') #2 /in/QEdfQ(20): unserialize('C:6:"Foobar":86...') #3 {main} thrown in /in/QEdfQ on line 15
Process exited with code 255.
Output for rfc.property-hooks
Deprecated: Foobar implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/QEdfQ on line 3 string(86) "O:12:"DateTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:14:"Europe/Andorra";}" string(14) "Europe/Andorra" string(86) "O:12:"DateTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:14:"Europe/Andorra";}" Fatal error: Uncaught DateObjectError: Object of type DateTimeZone has not been correctly initialized by calling parent::__construct() in its constructor in /in/QEdfQ:15 Stack trace: #0 /in/QEdfQ(15): DateTimeZone->getName() #1 [internal function]: Foobar->unserialize('O:12:"DateTimeZ...') #2 /in/QEdfQ(20): unserialize('C:6:"Foobar":86...') #3 {main} thrown in /in/QEdfQ on line 15
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.09 ms | 401 KiB | 8 Q