3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function test2(array $p = []) { print_r($p); return null; } public function getName($key) { return 'test' . $key; } } $a = new A; $b = 2; $a->($a->getName($b))([ 'firstName' => 'Nikita', 'secondName' => 'Gopkalo', ]); echo date('d.m.Y');
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in BKFeV on line 15
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected '[' in /in/7Yk9k on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected '[' in BKFeV on line 3
Process exited with code 255.

preferences:
172.78 ms | 1395 KiB | 49 Q