3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php interface A { const NONE = 0; } abstract class B implements A { public static function get() { $r = new \ReflectionClass(get_called_class()); return $r->getConstants(); } } class C extends B { const BLA = 1; } var_dump(C::get());
Output for 5.3.0 - 7.1.0
array(2) { ["BLA"]=> int(1) ["NONE"]=> int(0) }
Output for 5.0.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/chKGH on line 12 Fatal error: Call to undefined function get_called_class() in /in/chKGH on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/chKGH on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/chKGH on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/chKGH on line 3
Process exited with code 255.