3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Testing { public function scopeList() { echo "scopeList"; } public function __call($method, $parameters) { if($method == "list") { $this->scopeList(); } } public static function __callStatic($method, $parameters) { echo 1; die(); $instance = new static; call_user_func_array([$instance, $method], $parameters); } } Testing::list(); // fails Testing::{'list'}(); // works $testing = new Testing(); $testing->list(); //works
Output for 7.0.0 - 7.2.0
1
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected 'list' (T_LIST) in /in/SvdvO on line 22
Process exited with code 255.
Output for 5.4.10 - 5.4.45
Parse error: syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/SvdvO on line 22
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/SvdvO on line 18
Process exited with code 255.