3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function bar(string $foo) : string { return strtoupper($foo); } protected $foosdone = []; function __construct(array $foos) { $this->foosdone = array_map(function (string $foo) : string { return $this->bar($foo); }, $foos); } } new Foo(['a', 'b', 'c']);

preferences:
56.24 ms | 402 KiB | 5 Q