3v4l.org

run code in 300+ PHP versions simultaneously
<?php class logger { function __construct() { print "logger constructing\n"; } function __wakeup() { print "logger wakeup\n"; } function __destruct() { print "logger destruct\n"; } } class obj { var $prop; function __wakeup() { $this->prop = 'awake'; } } $a = []; $a[] = new stdclass; $a[0]->one = new logger; $a[] = new obj; $a[1]->prop =& $a[0]; $a[] =& $a[1]->one; var_dump(serialize($a)); $x = 'a:3:{i:0;O:8:"stdClass":1:{i:0;O:6:"logger":0:{}}i:1;O:3:"obj":1:{s:4:"prop";R:2;}i:2;R:3}'; $y = unserialize($x); var_dump($y);
Output for git.master, git.master_jit
logger constructing Deprecated: Creation of dynamic property obj::$one is deprecated in /in/trOiT on line 26 string(109) "a:3:{i:0;O:8:"stdClass":1:{s:3:"one";O:6:"logger":0:{}}i:1;O:3:"obj":2:{s:4:"prop";R:2;s:3:"one";N;}i:2;R:5;}" Notice: unserialize(): Error at offset 86 of 90 bytes in /in/trOiT on line 30 logger wakeup logger destruct bool(false) logger destruct
Output for rfc.property-hooks
logger constructing Deprecated: Creation of dynamic property obj::$one is deprecated in /in/trOiT on line 26 string(109) "a:3:{i:0;O:8:"stdClass":1:{s:3:"one";O:6:"logger":0:{}}i:1;O:3:"obj":2:{s:4:"prop";R:2;s:3:"one";N;}i:2;R:5;}" Warning: unserialize(): Error at offset 86 of 90 bytes in /in/trOiT on line 30 logger wakeup logger destruct bool(false) logger destruct

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:
39.36 ms | 401 KiB | 8 Q