3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //namespace a; //define('t', true, true); //define('a\\true', false, t); //define('a\\false', t, t); namespace Api\Something { class Foo { function Self() { } } } namespace Api\SomethingElse { //define('Api\\SomethingElse\\Private', 'Api\\Something', true); use Api\Something as Self; class Bar{ public function run() { //$obj = new Private; var_dump(Self, $obj); } } }
Output for 5.3.0 - 5.4.27
Fatal error: Cannot use Api\Something as Self because 'Self' is a special class name in /in/IJKi4 on line 21
Process exited with code 255.