3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace MyProject; function get($classname) { $a = __NAMESPACE__ . '\\' . $classname; return new $a; } class check { function __construct() { echo 'first'; } function check } class check { function __construct() { echo 'second'; } } $b = get('check');
Output for 5.3.3 - 5.4.13
Parse error: syntax error, unexpected '}', expecting '(' in /in/594m6 on line 17
Process exited with code 255.
Output for 5.3.0 - 5.3.2
Strict Standards: Redefining already defined constructor for class MyProject\check in /in/594m6 on line 16 Parse error: syntax error, unexpected '}', expecting '(' in /in/594m6 on line 17
Process exited with code 255.