3v4l.org

run code in 300+ PHP versions simultaneously
<?php $an_array = array(); $reflection = new ReflectionClass($an_object); $properties = $reflection->getProperties(); foreach ($properties as $property) { $property->setAccessible(true); $an_array[$property->getName()] = $property->getValue($an_object); if (!$property->isPublic()) $property->setAccessible(false); } var_dump($an_array);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $an_object in /in/8rSAI on line 4 Deprecated: ReflectionClass::__construct(): Passing null to parameter #1 ($objectOrClass) of type object|string is deprecated in /in/8rSAI on line 4 Fatal error: Uncaught ReflectionException: Class "" does not exist in /in/8rSAI:4 Stack trace: #0 /in/8rSAI(4): ReflectionClass->__construct('') #1 {main} thrown in /in/8rSAI on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

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


preferences:
48.52 ms | 401 KiB | 8 Q