3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo{ static $variable = array('func' => 'Foo::secondFunction'); public static function firstFunction(){ return "PHP 5.6!"; } public static function secondFunction(){ return "PHP 7!"; } } $variable = array('func' => 'firstFunction'); echo Foo::$variable['func']();
based on WOuYR
Output for 7.0.0 - 7.2.0
PHP 7!
Output for 5.3.21 - 5.6.28
PHP 5.6!