3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Bar { public static $baz = 5; protected static $bat = 4; private static $qux = 3; } $r = new ReflectionClass(Bar::class); var_dump($r->getStaticPropertyValue('baz')); var_dump($r->getStaticPropertyValue('bat')); var_dump($r->getStaticPropertyValue('qux'));
Output for 7.0.0 - 7.2.0
int(5) Fatal error: Uncaught ReflectionException: Class Bar does not have a property named bat in /in/ftquS:12 Stack trace: #0 /in/ftquS(12): ReflectionClass->getStaticPropertyValue('bat') #1 {main} thrown in /in/ftquS on line 12
Process exited with code 255.
Output for 5.5.24 - 5.6.28
int(5) Fatal error: Uncaught exception 'ReflectionException' with message 'Class Bar does not have a property named bat' in /in/ftquS:12 Stack trace: #0 /in/ftquS(12): ReflectionClass->getStaticPropertyValue('bat') #1 {main} thrown in /in/ftquS on line 12
Process exited with code 255.
Output for 5.4.2 - 5.4.45
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/ftquS on line 10
Process exited with code 255.
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /in/ftquS on line 10
Process exited with code 255.