3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar = 'protected_value'; private $baz = 'private_prop'; } $F = new Foo(); $F = serialize($F); var_dump($F); $F = str_replace('private_value','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
string(85) "O:3:"Foo":2:{s:6:"*bar";s:15:"protected_value";s:8:"Foobaz";s:12:"private_prop";}" object(Foo)#1 (2) { ["bar":protected]=> string(15) "protected_value" ["baz":"Foo":private]=> string(12) "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:
40.99 ms | 401 KiB | 8 Q