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.0
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 5.3.18 - 5.6.28
Fatal error: Class 'Test\Truc' not found in /in/3RFi2 on line 7
Process exited with code 255.