3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public B $c; } $class = new ReflectionClass(A::class); $defaults = $class->getDefaultProperties(); var_dump($defaults); var_dump(array_key_exists('c', $defaults));

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Parse error: syntax error, unexpected 'B' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/5eI7p on line 4
Output for Arrow functions
Parse error: syntax error, unexpected 'B' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/5eI7p on line 4
Output for Object typehint
Parse error: syntax error, unexpected 'B' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/5eI7p on line 4
Output for Array change keys
Parse error: syntax error, unexpected 'B' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/5eI7p on line 4
Output for Lexical anon
Parse error: syntax error, unexpected 'B' (T_STRING), expecting variable (T_VARIABLE) in /in/5eI7p on line 4

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page