3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function __call($name, $args){ echo "__call " . $name . PHP_EOL; } public static function __callStatic($name, $args) { echo "__callStatic " . $name . PHP_EOL; } function make_call() { $this->bob(); } function ted() { echo ":: doesn't always mean static" . PHP_EOL; } public static function ted() { echo "I know I should be static". PHP_EOL; } function make_call_static() { $this::ted(); } } $x = new foo(); $x->jim(); $x->make_call(); $x->make_call_static(); foo::sam();
Output for 5.3.0 - 5.4.7
Fatal error: Cannot redeclare foo::ted() in /in/n2AVu on line 20
Process exited with code 255.