3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { private $a = 1; private $b = '3'; private $c = ['foo', 'bar' => 'baz']; } $a = new a(); var_export($a); echo PHP_EOL .PHP_EOL; $arr = []; $closure = \Closure::bind(function () use ($arr, $a) { foreach ($mapping as $property => $value) { $object->$property = $value; } }, null, $object); $closure(); var_export($arr);
Output for git.master, git.master_jit, rfc.property-hooks
\a::__set_state(array( 'a' => 1, 'b' => '3', 'c' => array ( 0 => 'foo', 'bar' => 'baz', ), )) Warning: Undefined variable $object in /in/HZOFD on line 23 Warning: Undefined variable $mapping in /in/HZOFD on line 20 Warning: foreach() argument must be of type array|object, null given in /in/HZOFD on line 20 array ( )

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