3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Test { class Test { public function hello() { echo "HI"; } } } namespace Test { class Test { public function hello() { echo "HI3"; } } } namespace Test3 { $var = new \Test\Test; $var->hello(); }
based on PJ06P
Output for 7.0.0 - 7.2.6
Fatal error: Cannot declare class Test\Test, because the name is already in use in /in/u7TKE on line 13
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Class already declared: Test\Test in /in/u7TKE:13 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Cannot redeclare class Test\Test in /in/u7TKE on line 13
Process exited with code 255.