3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Some\Sub { class MyClass { public $v = 'first'; } } namespace Other\Subsection { class MyClass { public $v = 'second'; } } namespace { #use Some\Sub\MyClass; use Other\Subsection; $object = new MyClass; var_dump($object->v); }
based on 30s68
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'MyClass' not found in /in/tWTvH:25 Stack trace: #0 {main} thrown in /in/tWTvH on line 25
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Class 'MyClass' not found in /in/tWTvH on line 25
Process exited with code 255.