3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Hoge { protected $a = 'maa'; private $b = 2; } class TestHoge extends Hoge { public $a; public $b; public static function __set_state($an_array) { $obj = new Hoge; $obj->a = $an_array['a']; $obj->b = $an_array['b']; return $obj; } } $c = eval(var_export(new TestHoge, true).';'); print_r($c);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot access private property Hoge::$b in /in/uigbJ:17 Stack trace: #0 /in/uigbJ(22) : eval()'d code(1): TestHoge::__set_state(Array) #1 /in/uigbJ(22): eval() #2 {main} thrown in /in/uigbJ on line 17
Process exited with code 255.

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