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->second = $second; $ob->third = $third; $ob->fourth = $fourth; $ob->first = $first; 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.0070.00716.48
8.3.50.0130.00616.53
8.3.40.0120.00318.71
8.3.30.0000.01418.77
8.3.20.0000.00818.77
8.3.10.0080.00020.54
8.3.00.0000.00817.50
8.2.180.0140.00716.50
8.2.170.0120.00922.96
8.2.160.0070.00722.09
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.76
8.2.110.0070.00321.00
8.2.100.0060.00617.91
8.2.90.0070.00320.94
8.2.80.0080.00018.05
8.2.70.0000.00817.63
8.2.60.0050.00318.04
8.2.50.0050.00318.07
8.2.40.0030.00520.00
8.2.30.0000.00717.95
8.2.20.0000.00717.59
8.2.10.0040.00417.80
8.2.00.0030.00517.86
8.1.280.0090.00925.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0100.00022.42
8.1.230.0070.00420.71
8.1.220.0050.00317.78
8.1.210.0050.00318.96
8.1.200.0040.00417.34
8.1.190.0050.00217.53
8.1.180.0090.00018.10
8.1.170.0040.00418.71
8.1.160.0000.00718.82
8.1.150.0030.00618.61
8.1.140.0080.00017.56
8.1.130.0070.00017.75
8.1.120.0040.00417.44
8.1.110.0040.00317.39
8.1.100.0000.00817.44
8.1.90.0040.00417.46
8.1.80.0040.00417.53
8.1.70.0000.00717.46
8.1.60.0000.00817.48
8.1.50.0030.00717.48
8.1.40.0000.00717.42
8.1.30.0090.00017.66
8.1.20.0040.00417.65
8.1.10.0060.00317.48
8.1.00.0050.00217.46
8.0.300.0000.00719.95
8.0.290.0040.00416.75
8.0.280.0050.00318.44
8.0.270.0030.00317.27
8.0.260.0000.00716.74
8.0.250.0040.00416.96
8.0.240.0030.00616.91
8.0.230.0000.00816.97
8.0.220.0030.00316.99
8.0.210.0040.00416.74
8.0.200.0050.00317.00
8.0.190.0040.00417.04
8.0.180.0030.00616.92
8.0.170.0050.00316.95
8.0.160.0070.00017.04
8.0.150.0080.00016.80
8.0.140.0000.00816.85
8.0.130.0060.00013.38
8.0.120.0070.00016.84
8.0.110.0050.00316.87
8.0.100.0000.00816.70
8.0.90.0030.00516.79
8.0.80.0100.00716.88
8.0.70.0000.00816.96
8.0.60.0050.00316.95
8.0.50.0000.00716.77
8.0.30.0120.00617.06
8.0.20.0130.00917.11
8.0.10.0040.00416.96
8.0.00.0060.01216.73
7.4.330.0000.00513.02
7.4.320.0020.00516.53
7.4.300.0060.00016.60
7.4.290.0000.00716.62
7.4.280.0060.00316.48
7.4.270.0040.00416.62
7.4.260.0000.00513.23
7.4.250.0030.00616.57
7.4.240.0030.00316.61
7.4.230.0070.00016.43
7.4.220.0160.00716.68
7.4.210.0050.01116.49
7.4.200.0000.00716.70
7.4.190.0030.00316.56
7.4.160.0110.01116.61
7.4.150.0120.00617.07
7.4.140.0090.00917.16
7.4.130.0130.00516.54
7.4.120.0090.00816.61
7.4.110.0090.01216.50
7.4.100.0130.00716.56
7.4.90.0140.00316.60
7.4.80.0130.00917.62
7.4.70.0140.00316.43
7.4.60.0100.00716.57
7.4.50.0000.00418.31
7.4.40.0090.00621.69
7.4.30.0100.00616.61
7.4.00.0090.00614.86
7.3.330.0060.00013.15
7.3.320.0000.00513.23
7.3.310.0040.00416.30
7.3.300.0030.00316.34
7.3.290.0040.01416.31
7.3.280.0110.00716.28
7.3.270.0120.00617.07
7.3.260.0120.00618.24
7.3.250.0110.01116.42
7.3.240.0110.00516.42
7.3.230.0070.01016.54
7.3.210.0000.01716.46
7.3.200.0180.00319.39
7.3.190.0060.01416.63
7.3.180.0080.01016.38
7.3.170.0060.01016.62
7.3.160.0040.01116.29
7.3.120.0060.00615.02
7.3.10.0290.00416.06
7.3.00.0150.01215.96
7.2.330.0070.01016.68
7.2.320.0150.00316.41
7.2.310.0150.00416.68
7.2.300.0090.01116.42
7.2.290.0150.00616.60
7.2.130.0310.01016.27
7.2.120.0200.00716.53
7.2.110.0270.00416.46
7.2.100.0160.01617.05
7.2.90.0250.00316.66
7.2.80.0130.01316.29
7.2.70.0190.01916.53
7.2.60.0440.00916.71
7.2.50.0390.00616.68
7.2.40.0380.00716.71
7.2.30.0350.01116.98
7.2.20.0490.00716.88
7.2.10.0460.00616.59
7.2.00.0340.00518.14
7.1.250.0150.00615.52
7.1.100.0000.00917.89
7.1.70.0000.00916.95
7.1.60.0120.00919.40
7.1.50.0030.01516.96
7.1.00.0070.06722.36
7.0.200.0040.00416.80
7.0.140.0000.07722.00
7.0.120.0030.03022.04
7.0.60.0030.04019.94
7.0.50.0000.04717.70
7.0.40.0100.06320.11
7.0.30.0100.05020.03
7.0.20.0430.07020.09
7.0.10.0200.07320.24
7.0.00.0070.09020.25
5.6.280.0070.07020.77
5.6.210.0070.04320.57
5.6.200.0100.08318.20
5.6.190.0000.05320.65
5.6.180.0170.06020.39
5.6.170.0300.06020.45
5.6.160.0030.06020.46
5.6.150.0070.07718.12
5.6.140.0100.07718.15
5.6.130.0070.03718.28
5.6.120.0100.08021.04
5.6.110.0170.07721.02
5.6.100.0070.03720.98
5.6.90.0070.08321.01
5.6.80.0100.03320.49
5.6.70.4430.04020.38
5.5.350.0170.07720.43
5.5.340.0030.07718.04
5.5.330.0030.05020.31
5.5.320.0400.07320.27
5.5.310.0300.06720.28
5.5.300.0070.04717.94
5.5.290.0070.08017.98
5.5.280.0070.08720.68
5.5.270.0030.05720.67
5.5.260.0100.07320.89
5.5.250.0000.08720.56
5.5.240.3330.03320.27
5.4.450.1700.04019.65
5.4.440.1800.03319.55
5.4.430.1770.03719.50
5.4.420.1900.03719.45
5.4.410.2070.04019.28
5.4.400.1670.04018.86
5.4.390.1870.04019.15
5.4.380.1900.04318.98
5.4.370.1930.04018.98
5.4.360.2030.04319.00
5.4.350.1930.03319.22
5.4.340.0000.07718.87
5.4.320.0030.08319.07
5.4.310.0030.04019.24
5.4.300.1030.04318.98
5.4.290.1830.04019.19
5.4.280.1870.04019.22
5.4.270.1900.04019.13
5.4.260.1870.04719.09
5.4.250.1770.04018.87
5.4.240.1900.04718.97
5.4.230.1630.03719.08
5.4.220.1700.04018.83
5.4.210.1900.04319.14
5.4.200.1670.03718.84
5.4.190.1700.04018.98
5.4.180.1800.04719.21
5.4.170.1700.03319.30
5.4.160.1870.03318.85
5.4.150.1730.03318.98
5.4.140.1600.03716.52
5.4.130.1830.04016.50
5.4.120.1600.03716.50
5.4.110.1900.04316.19
5.4.100.1730.03316.45
5.4.90.1770.03316.55
5.4.80.1800.03316.55
5.4.70.0070.07016.53
5.4.60.0070.07016.49
5.4.50.0770.03316.43
5.4.40.1670.04316.43
5.4.30.1730.04016.42
5.4.20.1530.03716.34
5.4.10.1630.04016.53
5.4.00.1870.04015.80
5.3.290.1730.04714.75
5.3.280.1800.05014.57
5.3.270.1830.06314.66
5.3.260.1570.03314.68
5.3.250.1800.04014.51
5.3.240.1670.03714.75
5.3.230.1830.04314.71
5.3.220.1870.04714.48
5.3.210.1830.04314.59
5.3.200.1970.05014.57
5.3.190.0000.04714.56
5.3.180.0130.05714.58
5.3.170.0530.06014.71
5.3.160.1570.03714.48
5.3.150.1600.03714.49
5.3.140.1670.04014.64
5.3.130.1770.03314.52
5.3.120.1700.03714.78
5.3.110.1630.04014.77
5.3.100.1670.03714.26
5.3.90.1670.03714.07
5.3.80.1770.03014.17
5.3.70.1670.03713.95
5.3.60.1670.04013.98
5.3.50.1670.04013.96
5.3.40.1630.04014.10
5.3.30.1830.03313.91
5.3.20.1700.03013.77
5.3.10.1770.03013.57
5.3.00.1670.03313.86
5.2.170.1470.02311.38
5.2.160.1530.04311.32
5.2.150.1430.03011.37
5.2.140.1700.03311.05
5.2.130.1630.03311.19
5.2.120.1470.03011.03
5.2.110.1570.03711.21
5.2.100.1770.03011.19
5.2.90.1530.03711.01
5.2.80.1500.03711.00
5.2.70.1400.03311.05
5.2.60.1370.03011.05
5.2.50.1600.03311.03
5.2.40.1230.03710.97
5.2.30.1370.03010.98
5.2.20.1370.03311.12
5.2.10.1300.04010.98
5.2.00.1400.03010.80
5.1.60.1430.02310.00
5.1.50.1300.0339.89
5.1.40.1370.03010.22
5.1.30.1370.03010.31
5.1.20.1230.03010.32
5.1.10.1070.02710.15
5.1.00.1330.03310.08
5.0.50.0600.0178.64
5.0.40.0530.0208.41
5.0.30.0730.0278.39
5.0.20.0630.0308.32
5.0.10.0570.0308.16
5.0.00.0570.0308.07
4.4.90.0570.0137.70
4.4.80.0530.0177.70
4.4.70.0770.0137.70
4.4.60.0730.0207.70
4.4.50.0730.0237.70
4.4.40.0530.0277.70
4.4.30.0730.0237.70
4.4.20.0570.0177.70
4.4.10.0700.0277.70
4.4.00.0730.0377.70
4.3.110.0570.0177.70
4.3.100.0570.0137.70
4.3.90.0730.0207.70
4.3.80.0730.0337.70
4.3.70.0670.0277.70
4.3.60.0770.0207.70
4.3.50.0630.0177.70
4.3.40.0730.0407.70
4.3.30.0330.0337.70
4.3.20.0300.0307.70
4.3.10.0330.0237.70
4.3.00.0270.0207.70

preferences:
42.33 ms | 401 KiB | 5 Q