3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $x; public function __construct($x) { $this->x = $x; } private static $i = 0; private static function a($x) { return new self($x.(self::$i++)); } public static function b($y) { return array_map(array("Foo", "a"), array_merge($y, $y)); } } var_dump(Foo::b(array("a", "b", "c")));
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> object(Foo)#1 (1) { ["x"]=> string(2) "a0" } [1]=> object(Foo)#2 (1) { ["x"]=> string(2) "b1" } [2]=> object(Foo)#3 (1) { ["x"]=> string(2) "c2" } [3]=> object(Foo)#4 (1) { ["x"]=> string(2) "a3" } [4]=> object(Foo)#5 (1) { ["x"]=> string(2) "b4" } [5]=> object(Foo)#6 (1) { ["x"]=> string(2) "c5" } }

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.29 ms | 402 KiB | 8 Q