3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj = (object)array('a', 'b', 'c'); $refl = new \ReflectionObject($obj); $props = $refl->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED); foreach($props as $prop) print $prop->name; print_r(get_object_vars($obj)); print_r($obj);

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
012Array ( [0] => a [1] => b [2] => c ) stdClass Object ( [0] => a [1] => b [2] => c )
Output for Arrow functions
012Array ( [0] => a [1] => b [2] => c ) stdClass Object ( [0] => a [1] => b [2] => c )
Output for Object typehint
Array ( [0] => a [1] => b [2] => c ) stdClass Object ( [0] => a [1] => b [2] => c )
Output for Array change keys
Array ( [0] => a [1] => b [2] => c ) stdClass Object ( [0] => a [1] => b [2] => c )
Output for Lexical anon
Array ( [0] => a [1] => b [2] => c ) stdClass Object ( [0] => a [1] => b [2] => c )

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