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[0]->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}'; var_dump($x); $y = unserialize($x); var_dump($y);
Output for git.master, git.master_jit
logger constructing string(97) "a:3:{i:0;O:8:"stdClass":1:{s:3:"one";O:6:"logger":0:{}}i:1;O:3:"obj":1:{s:4:"prop";R:2;}i:2;R:3;}" string(90) "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}" Notice: unserialize(): Error at offset 86 of 90 bytes in /in/5EFbO on line 30 logger wakeup logger destruct bool(false) logger destruct
Output for rfc.property-hooks
logger constructing string(97) "a:3:{i:0;O:8:"stdClass":1:{s:3:"one";O:6:"logger":0:{}}i:1;O:3:"obj":1:{s:4:"prop";R:2;}i:2;R:3;}" string(90) "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}" Warning: unserialize(): Error at offset 86 of 90 bytes in /in/5EFbO 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:
45.29 ms | 402 KiB | 8 Q