3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Foo\Singleton; class Singleton { /** * The single instance */ private static $instance; /** * Prevent object creation */ private function __construct() {} private function __clone() {} /** * Get Singleton instance */ public static function getInstance() { if(is_null(self::instance)) { self::instance = new Singleton; } return self::instance; } } $singleton = Singleton::getInstance();
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected '=' in /in/9aXne on line 24
Process exited with code 255.