3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class PHPApprentice { private static $velocity = ''; private static $initialized = false; public static function initialize () { if ( self::initialized ) return; self::$initialized = true; self::$velocity = 'fast!'; } public static function getVelocity () { self::initialize(); return self::$velocity; } public static function setVelocity ( $value ) { self::$velocity = $value; self::initialized = true; } } PHPApprentice::setVelocity ( 'Ludicrous Speed!!' ); echo PHPApprentice::getVelocity();
Output for 5.3.0 - 5.4.23
Parse error: syntax error, unexpected '=' in /in/LkDjR on line 24
Process exited with code 255.