3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function test(array $p = []) { print_r($p); return null; } } $a = new A; $b = 'test'; $a->$b([ 'firstName' => 'Nikita', 'secondName' => 'Gopkalo', ]);

preferences:
47.85 ms | 402 KiB | 5 Q