3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace NameSpace\SubnamSpace; $objectName = 'Continent'; print $objectName; // Continent new $objectName; // Fatal error: Class 'Continent' not found new Continent; // Works $class = '\NameSpace\SubnamSpace\\' . $objectName; // new $class; // Works
Output for 7.0.0
Parse error: syntax error, unexpected 'NameSpace' (T_NAMESPACE), expecting '{' in /in/ggAle on line 3
Process exited with code 255.
Output for 5.4.10 - 5.6.16
Parse error: syntax error, unexpected 'NameSpace' (T_NAMESPACE), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) or '{' in /in/ggAle on line 3
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING or T_NS_SEPARATOR or '{' in /in/ggAle on line 3
Process exited with code 255.