3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace { class EvilStaticClass { public static function evilStaticMethod() { echo 'I am evil.'; } } class EvilNotInjectableClass { public function doStuff() { EvilStaticClass::evilStaticMethod(); } } } namespace Mock { class EvilStaticClassMock { public static function evilStaticMethod() { echo 'I am the evil method alias.'; } } } namespace Test { use Mock\EvilStaticClassMock as EvilStaticClass; $evilObject = new EvilNotInjectableClass(); $evilObject->doStuff(); }
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'Test\EvilNotInjectableClass' not found in /in/uTs6e:33 Stack trace: #0 {main} thrown in /in/uTs6e on line 33
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Class 'Test\EvilNotInjectableClass' not found in /in/uTs6e on line 33
Process exited with code 255.