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")));

preferences:
38.07 ms | 402 KiB | 5 Q