3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function x($i) { return $i; } public function abc() { return array_map(function($i) { return $$this->x($i); }, [1,2,3]); } } $a = new A(); var_dump($a->abc());
based on YV9nE
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class A could not be converted to string in /in/NJNPe on line 11
Process exited with code 255.
Output for 5.4.1 - 7.0.20
Catchable fatal error: Object of class A could not be converted to string in /in/NJNPe on line 11
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/NJNPe on line 12
Process exited with code 255.