3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace A\B; class Continent { } $objectName = 'Continent'; print $objectName; // Continent new Continent; // Works $class = '\A\B\\' . $objectName; // new $class; // Works new $objectName; // Fatal error: Class 'Continent' not found
based on 8spSS
Output for 7.0.0 - 7.2.0
Continent Fatal error: Uncaught Error: Class 'Continent' not found in /in/0s6in:16 Stack trace: #0 {main} thrown in /in/0s6in on line 16
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Continent Fatal error: Class 'Continent' not found in /in/0s6in on line 16
Process exited with code 255.