3v4l.org

run code in 300+ PHP versions simultaneously
<?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);

preferences:
54.25 ms | 402 KiB | 5 Q