3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $resolver; public function __construct(callable $resolver) { $this->resolver = $resolver; } public function resolve($record) { $this->resolver($record); } } $test = new Test(function($record) { var_dump($record); }); $test->resolve("hello");

preferences:
36.58 ms | 402 KiB | 5 Q