3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class PhpClassWithPropertyDefaults { public $propertyWithoutDefault; public $propertyWithNullDefault = null; public $propertyWithTrueDefault = true; } $class = new ReflectionClass('PhpClassWithPropertyDefaults'); var_dump($class->getProperty('propertyWithoutDefault')); var_dump($class->getProperty('propertyWithNullDefault')); var_dump($class->getProperty('propertyWithTrueDefault'));
Output for 5.0.0 - 5.6.21, 7.0.0 - 7.1.0
object(ReflectionProperty)#2 (2) { ["name"]=> string(22) "propertyWithoutDefault" ["class"]=> string(28) "PhpClassWithPropertyDefaults" } object(ReflectionProperty)#2 (2) { ["name"]=> string(23) "propertyWithNullDefault" ["class"]=> string(28) "PhpClassWithPropertyDefaults" } object(ReflectionProperty)#2 (2) { ["name"]=> string(23) "propertyWithTrueDefault" ["class"]=> string(28) "PhpClassWithPropertyDefaults" }
Output for hhvm-3.12.0
object(ReflectionProperty)#3 (4) { ["info"]=> array(9) { ["name"]=> string(22) "propertyWithoutDefault" ["default"]=> bool(true) ["defaultValue"]=> NULL ["access"]=> string(6) "public" ["accessible"]=> bool(true) ["modifiers"]=> int(256) ["class"]=> string(28) "PhpClassWithPropertyDefaults" ["doc"]=> bool(false) ["type"]=> bool(false) } ["name"]=> string(22) "propertyWithoutDefault" ["class"]=> string(28) "PhpClassWithPropertyDefaults" ["forceAccessible":"ReflectionProperty":private]=> bool(false) } object(ReflectionProperty)#3 (4) { ["info"]=> array(9) { ["name"]=> string(23) "propertyWithNullDefault" ["default"]=> bool(true) ["defaultValue"]=> NULL ["access"]=> string(6) "public" ["accessible"]=> bool(true) ["modifiers"]=> int(256) ["class"]=> string(28) "PhpClassWithPropertyDefaults" ["doc"]=> bool(false) ["type"]=> bool(false) } ["name"]=> string(23) "propertyWithNullDefault" ["class"]=> string(28) "PhpClassWithPropertyDefaults" ["forceAccessible":"ReflectionProperty":private]=> bool(false) } object(ReflectionProperty)#3 (4) { ["info"]=> array(9) { ["name"]=> string(23) "propertyWithTrueDefault" ["default"]=> bool(true) ["defaultValue"]=> bool(true) ["access"]=> string(6) "public" ["accessible"]=> bool(true) ["modifiers"]=> int(256) ["class"]=> string(28) "PhpClassWithPropertyDefaults" ["doc"]=> bool(false) ["type"]=> bool(false) } ["name"]=> string(23) "propertyWithTrueDefault" ["class"]=> string(28) "PhpClassWithPropertyDefaults" ["forceAccessible":"ReflectionProperty":private]=> bool(false) }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Ak9Ya 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_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Ak9Ya on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/Ak9Ya on line 4
Process exited with code 255.