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.40.0000.01418.70
8.3.30.0110.00318.70
8.3.20.0080.00018.58
8.3.10.0080.00020.36
8.3.00.0070.00021.81
8.2.170.0140.00022.96
8.2.160.0070.00720.35
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00019.36
8.2.110.0030.00622.20
8.2.100.0080.00317.84
8.2.90.0070.00019.13
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0060.00318.03
8.2.50.0080.00018.07
8.2.40.0040.00418.16
8.2.30.0040.00419.84
8.2.20.0080.00017.67
8.2.10.0080.00017.75
8.2.00.0050.00217.83
8.1.270.0040.00423.99
8.1.260.0040.01126.35
8.1.250.0070.00028.09
8.1.240.0030.00622.42
8.1.230.0110.00021.04
8.1.220.0000.00818.77
8.1.210.0030.00518.96
8.1.200.0030.00717.35
8.1.190.0030.00617.54
8.1.180.0030.00618.10
8.1.170.0050.00318.65
8.1.160.0000.00718.85
8.1.150.0040.00418.60
8.1.140.0000.00817.44
8.1.130.0030.00317.78
8.1.120.0070.00017.47
8.1.110.0040.00417.51
8.1.100.0030.00317.50
8.1.90.0040.00417.38
8.1.80.0050.00217.37
8.1.70.0030.00317.32
8.1.60.0030.00617.44
8.1.50.0040.00417.38
8.1.40.0000.00817.52
8.1.30.0000.00817.55
8.1.20.0040.00417.68
8.1.10.0000.00817.41
8.1.00.0000.00817.45
8.0.300.0050.00319.85
8.0.290.0000.00816.63
8.0.280.0000.00718.37
8.0.270.0030.00317.25
8.0.260.0000.00716.82
8.0.250.0070.00016.91
8.0.240.0000.00816.86
8.0.230.0050.00316.93
8.0.220.0030.00316.79
8.0.210.0040.00416.88
8.0.200.0040.00416.92
8.0.190.0000.00716.86
8.0.180.0050.00216.95
8.0.170.0000.00816.81
8.0.160.0030.00316.94
8.0.150.0030.00716.93
8.0.140.0000.01116.76
8.0.130.0000.00513.41
8.0.120.0030.00616.83
8.0.110.0030.00316.89
8.0.100.0000.00817.01
8.0.90.0000.00816.80
8.0.80.0060.00916.78
8.0.70.0000.00716.89
8.0.60.0050.00316.93
8.0.50.0030.00516.78
8.0.30.0090.01117.14
8.0.20.0090.01117.40
8.0.10.0000.00717.07
8.0.00.0050.01516.81
7.4.330.0020.00214.69
7.4.320.0040.00416.56
7.4.300.0030.00316.51
7.4.290.0030.00316.59
7.4.280.0070.00016.65
7.4.270.0030.00316.53
7.4.260.0030.00313.32
7.4.250.0030.00316.56
7.4.240.0030.00316.65
7.4.230.0030.00316.68
7.4.220.0130.01016.55
7.4.210.0080.00916.59
7.4.200.0000.00716.61
7.4.190.0000.00716.75
7.4.160.0130.00616.55
7.4.150.0090.01617.40
7.4.140.0070.01017.86
7.4.130.0060.01216.40
7.4.120.0170.00116.55
7.4.110.0170.00016.63
7.4.100.0100.01016.46
7.4.90.0100.00716.63
7.4.80.0030.01519.04
7.4.70.0120.00416.65
7.4.60.0090.00816.53
7.4.50.0030.00616.66
7.4.40.0040.01122.27
7.4.30.0170.00716.40
7.4.00.0070.00714.95
7.3.330.0050.00013.30
7.3.320.0000.00513.33
7.3.310.0030.00316.13
7.3.300.0030.00316.19
7.3.290.0040.01116.39
7.3.280.0070.01016.31
7.3.270.0110.00517.40
7.3.260.0100.01018.24
7.3.250.0110.00616.43
7.3.240.0100.00716.57
7.3.230.0080.00916.39
7.3.210.0180.00616.32
7.3.200.0140.00319.39
7.3.190.0130.00916.56
7.3.180.0060.00916.50
7.3.170.0040.01516.55
7.3.160.0060.00916.34
7.3.120.0060.01015.02
7.2.330.0140.00416.81
7.2.320.0110.00916.73
7.2.310.0030.01516.54
7.2.300.0080.00816.72
7.2.290.0100.00716.63
7.2.00.0000.01319.48
7.1.100.0030.00918.22
7.1.70.0080.00416.86
7.1.60.0030.02019.40
7.1.50.0120.00016.90
7.1.00.0000.07722.35
7.0.200.0000.00716.48
7.0.140.0070.07021.98
7.0.60.0030.06020.04
7.0.50.0100.07717.89
7.0.40.0130.08020.13
7.0.30.0300.08020.23
7.0.20.0300.05720.16
7.0.10.0070.05320.06
7.0.00.0200.07320.05
5.6.280.0070.07020.90
5.6.210.0130.06720.64
5.6.200.0100.08018.27
5.6.190.0100.07720.34
5.6.180.0270.05720.39
5.6.170.0270.04020.47
5.6.160.0030.08320.54
5.6.150.0130.07018.15
5.6.140.0030.05718.19
5.6.130.0130.05018.15
5.6.120.0100.03721.15
5.6.110.0100.07720.96
5.6.100.0100.07020.98
5.6.90.0130.07021.00
5.6.80.0070.04320.41
5.5.350.0300.06020.30
5.5.340.0170.07318.07
5.5.330.0030.08720.29
5.5.320.0100.04320.27
5.5.310.0270.04320.51
5.5.300.0030.08018.01
5.5.290.0000.08717.97
5.5.280.0030.06320.98
5.5.270.0030.09020.96
5.5.260.0170.07320.77
5.5.250.0100.04020.55
5.5.240.0100.05720.19
5.4.450.4300.03719.51
5.4.440.3400.04019.25
5.4.430.3130.03319.36
5.4.420.3330.03319.36
5.4.410.3300.04019.28
5.4.400.3330.04019.23
5.4.390.2930.03719.04
5.4.380.3370.03318.96
5.4.370.3500.04319.04
5.4.360.3570.03719.22
5.4.350.4600.04719.06
5.4.340.4230.04319.13
5.4.320.3700.04718.92
5.4.310.3200.03719.10
5.4.300.4300.04019.22
5.4.290.3630.03319.14
5.4.280.3900.05019.24
5.4.270.3770.03319.13
5.4.260.3630.03719.19
5.4.250.3630.03718.91
5.4.240.4570.03318.92
5.4.230.3600.03719.11
5.4.220.3330.03319.24
5.4.210.4200.03718.96
5.4.200.4430.03719.21
5.4.190.4000.03318.95
5.4.180.3470.04019.11
5.4.170.4370.04019.21
5.4.160.3330.03719.09
5.4.150.3700.02719.15
5.4.140.4030.03316.40
5.4.130.3970.03716.43
5.4.120.3930.03716.35
5.4.110.4300.03316.52
5.4.100.4370.03716.48
5.4.90.4300.03016.56
5.4.80.4130.03716.44
5.4.70.4300.03716.33
5.4.60.4330.03716.41
5.4.50.4100.03316.45
5.4.40.4270.04016.45
5.4.30.4330.03316.60
5.4.20.4070.04016.41
5.4.10.3900.03716.29
5.4.00.3400.03315.92
5.3.290.3800.03714.73
5.3.280.4230.04314.52
5.3.270.3370.03314.63
5.3.260.3570.03714.65
5.3.250.4300.04014.61
5.3.240.4300.04014.66
5.3.230.3970.03714.61
5.3.220.4130.03314.62
5.3.210.4200.03714.62
5.3.200.4370.03714.57
5.3.190.3900.04014.56
5.3.180.5170.04014.64
5.3.170.4000.03314.57
5.3.160.3400.03714.46
5.3.150.4170.03714.57
5.3.140.4300.03314.61
5.3.130.4170.04014.58
5.3.120.3900.04314.44
5.3.110.3430.03014.60
5.3.100.3400.02714.09
5.3.90.3500.03713.94
5.3.80.4070.04314.05
5.3.70.4230.04013.94
5.3.60.4170.03714.00
5.3.50.4100.03313.98
5.3.40.3500.04714.02
5.3.30.3530.03713.96
5.3.20.3570.03713.58
5.3.10.3600.04013.62
5.3.00.4000.03313.79
5.2.170.3130.02711.18
5.2.160.3130.02711.20
5.2.150.2870.05011.09
5.2.140.2800.02711.07
5.2.130.2970.02311.00
5.2.120.3070.03011.27
5.2.110.2970.03311.11
5.2.100.3430.02311.25
5.2.90.3530.02711.00
5.2.80.2830.02711.25
5.2.70.2730.02311.26
5.2.60.3100.03711.01
5.2.50.3100.03311.04
5.2.40.2230.02710.99
5.2.30.2230.03010.92
5.2.20.3000.03711.00
5.2.10.2270.02310.92
5.2.00.2300.02710.72
5.1.60.2300.02710.00
5.1.50.2170.02710.04
5.1.40.2270.0239.99
5.1.30.2270.02710.34
5.1.20.2170.02010.42
5.1.10.2270.03010.01
5.1.00.2270.02310.04
5.0.50.0870.0208.69
5.0.40.1170.0208.48
5.0.30.1130.0278.24
5.0.20.1170.0208.20
5.0.10.1300.0208.22
5.0.00.1300.0308.14
4.4.90.1130.0136.17
4.4.80.1130.0136.17
4.4.70.1130.0136.17
4.4.60.1330.0176.17
4.4.50.1370.0206.17
4.4.40.1200.0236.17
4.4.30.1100.0136.17
4.4.20.1100.0176.17
4.4.10.1070.0176.17
4.4.00.1200.0236.17
4.3.110.1100.0136.17
4.3.100.0930.0136.17
4.3.90.1200.0136.17
4.3.80.1200.0236.17
4.3.70.1370.0136.17
4.3.60.1170.0136.17
4.3.50.1130.0136.17
4.3.40.1330.0306.17
4.3.30.0530.0206.17
4.3.20.0570.0176.17
4.3.10.0700.0236.17
4.3.00.0570.0136.17

preferences:
38.92 ms | 400 KiB | 5 Q