3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $a = 'a'; protected $b = 'b'; private $c = 'c'; } function objectToArray ($object) { $array = (array) $object; return array_combine( array_map(function($k) { return $k}, array_keys($array)), array_values($array) ); } $array = objectToArray( new \Test()); var_export((array) new \Test());

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.170.0030.01015.52

preferences:
145.77 ms | 1394 KiB | 7 Q