3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Test { class Example { public function __construct() { new Truc(); } } } namespace { class Truc {} new \Test\Example(); }
Output for 7.0.0 - 7.2.12
Fatal error: Uncaught Error: Class 'Test\Truc' not found in /in/3RFi2:7 Stack trace: #0 /in/3RFi2(15): Test\Example->__construct() #1 {main} thrown in /in/3RFi2 on line 7
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Class undefined: Test\Truc in /in/3RFi2:-1 Stack trace: #0 /in/3RFi2(-1): Test\Example->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.11.1 - 3.21.3
Fatal error: Uncaught Error: Class undefined: Test\Truc in /in/3RFi2:7 Stack trace: #0 /in/3RFi2(15): Test\Example->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: Class undefined: Test\Truc in /in/3RFi2 on line 7
Process exited with code 255.
Output for 5.3.18 - 5.6.38
Fatal error: Class 'Test\Truc' not found in /in/3RFi2 on line 7
Process exited with code 255.