3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $a = 'protected_prop'; private $b = 'private_prop'; } $F = new Foo(); var_dump($F); $F = serialize($F); $F = str_replace('protected_prop','new_protected_prop',$F); $F = str_replace('private_prop','new_private_prop',$F); $F = preg_replace_callback ( '!s:(\d+):"(.*?)";!', function($match) { return ($match[1] == strlen($match[2])) ? $match[0] : 's:' . strlen($match[2]) . ':"' . $match[2] . '";'; },$F ); $F = @unserialize($F); var_dump($F);
Output for git.master, git.master_jit, rfc.property-hooks
object(Foo)#1 (2) { ["a":protected]=> string(14) "protected_prop" ["b":"Foo":private]=> string(12) "private_prop" } object(Foo)#1 (2) { ["a":protected]=> string(18) "new_protected_prop" ["b":"Foo":private]=> string(16) "new_private_prop" }

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