3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Geolocation { function myMethod($param1, $param2) { return $param1 . ' ' . $param2; } } $method = 'myMethod'; $params = [1, 2]; $geo = new Geolocation(); $res = $geo->{$method}(...$params); echo json_encode($res);
based on 9uT4f
Output for 5.6.0 - 7.3.1
"1 2"
Output for 5.5.0 - 5.5.38
Parse error: syntax error, unexpected '.' in /in/i9n28 on line 12
Process exited with code 255.