3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class Foo { private static $instance = NULL; private function __construct() { } public static function getInstance() { return static::$instance === NULL ? static::$instance = new static() ? static::$instance; } } final class Bar extends Foo { } final class Baz extends Foo { } $bar = Bar::getInstance(); echo get_class($bar), "\n"; $baz = Baz::getInstance(); echo get_class($baz), "\n";
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected ';' in /in/AEbMH on line 8
Process exited with code 255.