3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php final class MyType { const UNKNOWN = 0; const VALUE_ONE = 1; const VALUE_TWO = 2; const VALUE_THREE = 3; const VALUE_FOUR = 4; const VALUE_FIVE = 5; static public $__names = array( 0 => 'UNKNOWN', 1 => 'VALUE_ONE', 2 => 'VALUE_TWO', 3 => 'VALUE_THREE', 4 => 'VALUE_FOUR', 5 => 'VALUE_FIVE', ); } $test = new MyType(); echo constant('MyType' . $test->__names[count($test->__names) - 1]); ?>
Output for 7.0.0 - 7.1.0
Notice: Accessing static property MyType::$__names as non static in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Notice: Accessing static property MyType::$__names as non static in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Warning: constant(): Couldn't find constant MyType in /in/XgbDK on line 22
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Warning: constant(): Couldn't find constant MyType in /in/XgbDK on line 22
Output for 5.2.6 - 5.6.28
Strict Standards: Accessing static property MyType::$__names as non static in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Strict Standards: Accessing static property MyType::$__names as non static in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Warning: constant(): Couldn't find constant MyType in /in/XgbDK on line 22
Output for 5.0.5 - 5.2.5
Strict Standards: Accessing static property MyType::$__names as non static in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Strict Standards: Accessing static property MyType::$__names as non static in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Warning: constant(): Couldn't find constant MyType in /in/XgbDK on line 22
Output for 5.0.0 - 5.0.4
Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Notice: Undefined property: MyType::$__names in /in/XgbDK on line 22 Warning: constant(): Couldn't find constant MyType in /in/XgbDK on line 22
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/XgbDK on line 4
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_CLASS in /in/XgbDK on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/XgbDK on line 4
Process exited with code 255.