3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo PHP_VERSION; namespace MyProject { const CONNECT_OK = 1; class Connection { static public function start() { echo 'started'; } } function connect() { /* ... */ } } namespace { // global code session_start(); $a = MyProject\connect(); echo MyProject\Connection::start(); }
Output for 5.3.0 - 5.4.8
Fatal error: Namespace declaration statement has to be the very first statement in the script in /in/X3fQs on line 3
Process exited with code 255.