3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Will error on PHP <5.6 due to property declaration class Foo{ static $variable = array('func' => __CLASS__ . '::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 qNT6X
Output for 7.0.0 - 7.2.0
PHP 7!
Output for 5.6.0 - 5.6.28
PHP 5.6!
Output for 5.5.0 - 5.5.38
Parse error: syntax error, unexpected '.', expecting ')' in /in/WOuYR on line 7
Process exited with code 255.