3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ob = 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)
8.3.60.0110.00718.43
8.3.50.0140.00522.05
8.3.40.0070.00718.54
8.3.30.0100.00318.76
8.3.20.0080.00018.68
8.3.10.0080.00020.48
8.3.00.0080.00419.38
8.2.180.0090.01216.50
8.2.170.0100.01022.96
8.2.160.0040.00922.13
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0070.00019.76
8.2.110.0100.00720.92
8.2.100.0060.00617.84
8.2.90.0000.00919.04
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0000.00718.05
8.2.50.0000.00818.07
8.2.40.0050.00218.22
8.2.30.0000.00719.78
8.2.20.0000.00717.74
8.2.10.0040.00417.63
8.2.00.0090.00017.82
8.1.280.0100.00725.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00422.47
8.1.230.0030.00721.02
8.1.220.0070.00018.77
8.1.210.0040.00418.88
8.1.200.0060.00317.35
8.1.190.0040.00417.53
8.1.180.0000.00918.10
8.1.170.0040.00418.73
8.1.160.0050.00218.89
8.1.150.0080.00018.66
8.1.140.0040.00417.38
8.1.130.0030.00317.80
8.1.120.0000.00717.39
8.1.110.0040.00417.46
8.1.100.0000.00717.32
8.1.90.0040.00417.45
8.1.80.0030.00317.48
8.1.70.0000.00717.50
8.1.60.0020.00517.52
8.1.50.0000.00917.55
8.1.40.0000.00917.44
8.1.30.0000.00917.72
8.1.20.0040.00417.52
8.1.10.0060.00317.39
8.1.00.0080.00017.46
8.0.300.0000.00719.89
8.0.290.0070.00016.63
8.0.280.0070.00018.45
8.0.270.0030.00317.21
8.0.260.0070.00016.74
8.0.250.0000.00816.85
8.0.240.0090.00017.03
8.0.230.0040.00416.88
8.0.220.0030.00316.82
8.0.210.0070.00016.86
8.0.200.0040.00416.98
8.0.190.0000.00817.01
8.0.180.0050.00316.80
8.0.170.0040.00416.91
8.0.160.0000.00816.80
8.0.150.0030.00516.79
8.0.140.0000.00716.86
8.0.130.0000.00513.29
8.0.120.0040.00416.90
8.0.110.0000.00716.88
8.0.100.0000.00716.95
8.0.90.0000.00716.80
8.0.80.0100.01116.88
8.0.70.0030.00317.02
8.0.60.0030.00616.74
8.0.50.0090.00016.85
8.0.30.0140.00717.10
8.0.20.0110.00917.40
8.0.10.0050.00217.09
8.0.00.0080.01116.62
7.4.330.0000.00514.84
7.4.320.0030.00316.64
7.4.300.0030.00316.50
7.4.290.0000.00716.62
7.4.280.0060.00316.54
7.4.270.0070.00016.54
7.4.260.0000.00713.29
7.4.250.0040.00416.46
7.4.240.0000.00816.66
7.4.230.0080.00016.68
7.4.220.0070.01316.52
7.4.210.0080.00716.61
7.4.200.0030.00316.38
7.4.190.0040.00416.38
7.4.160.0120.00316.32
7.4.150.0100.00717.40
7.4.140.0120.00817.86
7.4.130.0080.00816.43
7.4.120.0130.00616.57
7.4.110.0100.00716.38
7.4.100.0120.00916.64
7.4.90.0140.00316.60
7.4.80.0140.00519.04
7.4.70.0150.00916.50
7.4.60.0100.00716.60
7.4.50.0000.00716.55
7.4.40.0000.01622.27
7.4.30.0130.00316.66
7.4.00.0000.01114.99
7.3.330.0050.00013.32
7.3.320.0000.00513.26
7.3.310.0040.00416.18
7.3.300.0040.00416.25
7.3.290.0060.00916.33
7.3.280.0060.00916.29
7.3.270.0090.00917.40
7.3.260.0110.00818.24
7.3.250.0110.00916.48
7.3.240.0070.01016.37
7.3.230.0070.01016.39
7.3.210.0140.00716.42
7.3.200.0180.00419.39
7.3.190.0060.01416.35
7.3.180.0090.00616.39
7.3.170.0070.01016.29
7.3.160.0060.01016.41
7.3.120.0030.01514.86
7.2.330.0130.00316.49
7.2.320.0060.01216.71
7.2.310.0150.00616.73
7.2.300.0060.00916.56
7.2.290.0090.00916.66
7.2.60.0030.01016.92
7.2.00.0060.00619.38
7.1.200.0040.00715.87
7.1.100.0030.01018.25
7.1.70.0000.01017.14
7.1.60.0040.00716.89
7.1.50.0100.00016.62
7.1.00.0030.06022.32
7.0.200.0030.00616.74
7.0.140.0030.07322.04
7.0.60.0130.06019.99
7.0.50.0030.08317.96
7.0.40.0030.07720.15
7.0.30.0270.06320.11
7.0.20.0300.08320.07
7.0.10.0030.08320.06
7.0.00.0200.06020.09
5.6.280.0030.07321.07
5.6.210.0070.06720.47
5.6.200.0070.04018.19
5.6.190.0070.05020.58
5.6.180.3500.04320.61
5.6.170.0300.07020.50
5.6.160.0100.04720.50
5.6.150.0030.04018.14
5.6.140.0100.07718.21
5.6.130.0000.05318.17
5.6.120.0070.07021.02
5.6.110.0070.08020.98
5.6.100.0070.07020.89
5.6.90.0030.04321.02
5.6.80.0130.07720.54
5.5.350.0330.07320.33
5.5.340.0100.07717.97
5.5.330.0200.07720.31
5.5.320.0200.04320.41
5.5.310.0370.07320.26
5.5.300.0000.08717.95
5.5.290.0030.05318.03
5.5.280.0070.03720.65
5.5.270.0030.06020.75
5.5.260.0170.06020.80
5.5.250.0070.05720.71
5.5.240.0130.07020.37
5.4.450.0030.04319.25
5.4.440.0000.08319.46
5.4.430.0100.07719.24
5.4.420.0030.08719.18
5.4.410.0100.05719.18
5.4.400.0170.03019.25
5.4.390.0030.05019.14
5.4.380.0000.04319.14
5.4.370.0170.06719.20
5.4.360.0070.04719.14
5.4.350.0200.06019.14
5.4.340.0100.07319.16
5.4.320.0100.07719.25
5.4.310.0030.05019.14
5.4.300.0130.03719.08
5.4.290.0070.04019.20
5.4.280.0070.06318.92
5.4.270.0170.06719.15
5.4.260.0100.05018.87
5.4.250.0070.05719.21
5.4.240.0070.07019.23
5.4.230.0030.04318.84
5.4.220.0130.03318.86
5.4.210.0130.07019.07
5.4.200.0030.06718.84
5.4.190.0100.07019.07
5.4.180.0100.07318.96
5.4.170.0030.06718.96
5.4.160.0070.07018.85
5.4.150.0170.06319.13
5.4.140.0070.05016.39
5.4.130.0030.08016.30
5.4.120.0000.04716.37
5.4.110.0030.05016.39
5.4.100.0070.06016.39
5.4.90.0070.08016.54
5.4.80.0070.07016.37
5.4.70.0070.07716.48
5.4.60.0030.07016.38
5.4.50.0030.07316.38
5.4.40.0130.06716.25
5.4.30.0070.04716.38
5.4.20.0030.04716.34
5.4.10.0070.04316.34
5.4.00.0070.05715.82
5.3.290.0030.05714.71
5.3.280.0170.07014.64
5.3.270.0070.06314.68
5.3.260.0030.07714.53
5.3.250.0100.05014.61
5.3.240.0100.07714.64
5.3.230.0170.06314.62
5.3.220.0030.07714.48
5.3.210.0100.05714.57
5.3.200.0000.07714.73
5.3.190.0200.03314.56
5.3.180.0000.04314.62
5.3.170.0170.06714.56
5.3.160.0070.07714.60
5.3.150.0000.05714.74
5.3.140.0070.06014.63
5.3.130.0070.04714.70
5.3.120.0100.07314.62
5.3.110.0070.07714.44
5.3.100.0070.03714.04
5.3.90.0130.04314.03
5.3.80.0000.04014.09
5.3.70.0130.03314.05
5.3.60.0100.03014.04
5.3.50.0070.04013.86
5.3.40.0070.07313.95
5.3.30.0100.03714.06
5.3.20.0030.07713.72
5.3.10.0030.06013.71
5.3.00.0070.03713.67
5.2.170.0070.03311.20
5.2.160.0030.03711.21
5.2.150.0070.03711.20
5.2.140.0100.05311.15
5.2.130.0000.03711.25
5.2.120.0000.03311.14
5.2.110.0130.02711.05
5.2.100.0070.02711.04
5.2.90.0070.05311.10
5.2.80.0030.05311.11
5.2.70.0030.06010.98
5.2.60.0030.04311.05
5.2.50.0030.06711.09
5.2.40.0130.05010.96
5.2.30.0130.04710.98
5.2.20.0100.05710.96
5.2.10.0030.03010.93
5.2.00.0000.05010.79
5.1.60.0000.02710.15
5.1.50.0070.05310.00
5.1.40.0100.0479.98
5.1.30.0070.05310.39
5.1.20.0000.06010.35
5.1.10.0070.05010.04
5.1.00.0030.03710.12
5.0.50.0030.0238.71
5.0.40.0000.0478.44
5.0.30.0000.0508.30
5.0.20.0030.0208.25
5.0.10.0000.0278.13
5.0.00.0030.0608.16
4.4.90.0030.0378.03
4.4.80.0070.0108.03
4.4.70.0000.0278.03
4.4.60.0000.0238.03
4.4.50.0000.0178.03
4.4.40.0030.0238.03
4.4.30.0000.0278.03
4.4.20.0030.0208.03
4.4.10.0000.0278.03
4.4.00.0070.0338.03
4.3.110.0000.0238.03
4.3.100.0000.0208.03
4.3.90.0030.0308.03
4.3.80.0030.0538.03
4.3.70.0000.0208.03
4.3.60.0000.0178.03
4.3.50.0000.0178.03
4.3.40.0100.0408.03
4.3.30.0000.0178.03
4.3.20.0000.0408.03
4.3.10.0030.0378.03
4.3.00.0000.0278.03

preferences:
42.44 ms | 401 KiB | 5 Q