3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ob = new stdClass(); $ob->value = new stdClass(); $first = array(1); $second = array('1'); $third = new stdClass(); $third->{0} = 1; $fourth = new stdClass(); $fourth->'0' = 1; $ob->first = $first; $ob->second = $second; $ob->third = $third; $ob->fourth = $fourth; print_r($ob); print_r(object_to_array($ob)); function object_to_array( $object ) { if( ! is_array( $object ) && ! is_object( $object )) { return $object; } if( is_object( $object )) { $object = get_object_vars( $object ); } return array_map( 'object_to_array', $object ); }

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)
5.4.160.0100.07719.10
5.4.150.0030.06718.84
5.4.140.0230.05716.38
5.4.130.0100.07316.41
5.4.120.0070.07316.54
5.4.110.0070.05716.39
5.4.100.0100.07316.41
5.4.90.0070.07016.34
5.4.80.0030.04316.41
5.4.70.0070.03316.26
5.4.60.0030.04316.43
5.4.50.0170.02316.43
5.4.40.0000.04016.25
5.4.30.0070.07016.38
5.4.20.0130.04716.27
5.4.10.0100.07316.40
5.4.00.0000.05315.80
5.3.260.0070.06014.40
5.3.250.0100.03714.53
5.3.240.0030.07314.50
5.3.230.0030.08314.52
5.3.220.0100.07014.54
5.3.210.0000.05314.48
5.3.200.0070.07314.49
5.3.190.0030.08014.68
5.3.180.0130.06314.54
5.3.170.0070.04314.44
5.3.160.0100.07314.50
5.3.150.0130.03314.53
5.3.140.0030.04014.48
5.3.130.0030.08014.47
5.3.120.0100.07014.34
5.3.110.0030.08314.34
5.3.100.0070.06713.97
5.3.90.0070.07313.99
5.3.80.0000.05714.00
5.3.70.0070.07313.97
5.3.60.0030.08014.12
5.3.50.0070.05313.89
5.3.40.0070.06313.79
5.3.30.0130.04713.89
5.3.20.0130.07313.52
5.3.10.0070.07013.50
5.3.00.0100.04713.46

preferences:
147.27 ms | 1386 KiB | 7 Q