3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $test = ''; } $test = new Test(); echo 'before' . PHP_EOL; foreach ($test as $key => $value) { echo $key . ' ' . $value . PHP_EOL; } $test->testing = 'testing'; $test->_testing = 'testing2'; echo 'after' . PHP_EOL; foreach ($test as $key => $value) { echo $key . ' ' . $value . PHP_EOL; } var_dump($test); $test2 = unserialize(base64_decode(base64_encode(serialize($test)))); var_dump($test2); echo 'round2' . PHP_EOL; foreach ($test as $key => $value) { echo $key . ' ' . $value . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
before Deprecated: Creation of dynamic property Test::$testing is deprecated in /in/GYZnX on line 13 Deprecated: Creation of dynamic property Test::$_testing is deprecated in /in/GYZnX on line 14 after testing testing _testing testing2 object(Test)#1 (3) { ["test":protected]=> string(0) "" ["testing"]=> string(7) "testing" ["_testing"]=> string(8) "testing2" } Deprecated: Creation of dynamic property Test::$testing is deprecated in /in/GYZnX on line 21 Deprecated: Creation of dynamic property Test::$_testing is deprecated in /in/GYZnX on line 21 object(Test)#2 (3) { ["test":protected]=> string(0) "" ["testing"]=> string(7) "testing" ["_testing"]=> string(8) "testing2" } round2 testing testing _testing testing2

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:
71.29 ms | 402 KiB | 8 Q