3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo{ static $variable = array('func' => __CLASS__ . '::secondFunction'); public static function firstFunction(){ return "PHP5!"; } public static function secondFunction(){ return "PHP7!"; } } $variable = array('func' => 'firstFunction'); echo Foo::$variable['func']();
based on JoViI
Output for 7.0.0 - 7.2.0
PHP7!
Output for 5.6.8 - 5.6.28
PHP5!
Output for 5.3.21 - 5.5.35
Parse error: syntax error, unexpected '.', expecting ')' in /in/qNT6X on line 5
Process exited with code 255.