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)
8.3.60.0070.00716.50
8.3.50.0150.00717.43
8.3.40.0100.01018.71
8.3.30.0040.01118.63
8.3.20.0040.00418.65
8.3.10.0080.00020.28
8.3.00.0190.00019.25
8.2.180.0170.00318.19
8.2.170.0110.00422.96
8.2.160.0100.00720.38
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0090.00019.23
8.2.110.0000.00921.12
8.2.100.0090.00317.91
8.2.90.0060.00319.47
8.2.80.0090.00019.46
8.2.70.0030.00617.63
8.2.60.0070.00318.05
8.2.50.0030.00618.07
8.2.40.0040.00418.16
8.2.30.0050.00318.03
8.2.20.0040.00417.74
8.2.10.0040.00417.67
8.2.00.0050.00317.77
8.1.280.0040.01125.92
8.1.270.0020.00524.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00823.84
8.1.230.0060.00620.94
8.1.220.0070.00017.79
8.1.210.0070.00318.90
8.1.200.0070.00317.35
8.1.190.0000.00717.63
8.1.180.0050.00318.10
8.1.170.0060.00320.67
8.1.160.0040.00418.86
8.1.150.0040.00418.63
8.1.140.0000.00917.43
8.1.130.0030.00317.81
8.1.120.0000.00717.45
8.1.110.0050.00217.51
8.1.100.0000.00717.54
8.1.90.0030.00517.51
8.1.80.0030.00317.45
8.1.70.0000.00717.38
8.1.60.0050.00417.64
8.1.50.0030.00517.55
8.1.40.0040.00417.55
8.1.30.0000.00917.63
8.1.20.0040.00417.71
8.1.10.0040.00417.50
8.1.00.0050.00517.47
8.0.300.0030.00520.03
8.0.290.0000.00716.63
8.0.280.0030.00518.35
8.0.270.0000.00717.34
8.0.260.0050.00316.75
8.0.250.0000.00716.90
8.0.240.0000.00716.89
8.0.230.0030.00316.98
8.0.220.0030.00316.87
8.0.210.0080.00016.86
8.0.200.0000.00616.91
8.0.190.0050.00316.96
8.0.180.0040.00416.87
8.0.170.0080.00016.91
8.0.160.0030.00316.77
8.0.150.0080.00016.85
8.0.140.0060.00616.88
8.0.130.0050.00013.34
8.0.120.0000.00816.78
8.0.110.0040.00416.98
8.0.100.0040.00416.75
8.0.90.0020.00516.81
8.0.80.0000.01616.91
8.0.70.0030.00516.80
8.0.60.0030.00516.89
8.0.50.0000.00716.86
8.0.30.0080.01016.99
8.0.20.0120.01017.13
8.0.10.0040.00416.91
8.0.00.0110.01016.72
7.4.330.0000.00513.03
7.4.320.0040.00416.55
7.4.300.0000.00616.51
7.4.290.0030.00316.58
7.4.280.0000.00816.54
7.4.270.0070.00016.46
7.4.260.0030.00313.17
7.4.250.0080.00016.67
7.4.240.0000.00716.39
7.4.230.0000.00816.61
7.4.220.0110.00716.62
7.4.210.0110.00716.59
7.4.200.0000.00816.59
7.4.190.0000.00716.67
7.4.160.0120.00316.36
7.4.150.0030.01416.47
7.4.140.0100.00816.49
7.4.130.0040.01416.54
7.4.120.0080.00916.45
7.4.110.0110.01116.34
7.4.100.0100.00616.72
7.4.90.0110.00816.45
7.4.80.0130.00919.39
7.4.70.0070.01016.45
7.4.60.0090.00916.28
7.4.50.0000.00716.47
7.4.40.0030.00616.57
7.4.30.0060.00916.58
7.4.00.0130.00014.86
7.3.330.0000.00613.17
7.3.320.0050.00013.31
7.3.310.0030.00316.35
7.3.300.0000.00616.19
7.3.290.0090.00616.23
7.3.280.0090.00916.31
7.3.270.0030.01316.38
7.3.260.0110.00716.39
7.3.250.0080.01116.31
7.3.240.0140.00316.61
7.3.230.0090.00816.37
7.3.210.0080.01216.53
7.3.200.0090.00916.39
7.3.190.0060.01216.41
7.3.180.0060.01016.52
7.3.170.0090.00616.36
7.3.160.0040.01316.40
7.3.120.0070.01015.05
7.2.330.0140.01116.80
7.2.320.0130.00616.86
7.2.310.0100.01316.74
7.2.300.0060.01016.55
7.2.290.0070.01016.69
7.2.80.0040.00416.86
7.2.60.0060.00916.96
7.2.50.0060.00617.02
7.1.200.0040.00815.78
7.1.100.0030.01318.27
7.1.70.0040.00817.07
7.1.60.0060.01919.40
7.1.50.0140.01116.83
7.1.00.0030.06322.45
7.0.200.0040.00416.67
7.0.140.0070.07022.21
7.0.120.0000.07722.04
7.0.60.0030.07720.03
7.0.50.0030.04317.92
7.0.40.0070.09020.25
7.0.30.0330.07320.23
7.0.20.0230.03720.12
7.0.10.0070.08320.25
7.0.00.0170.07720.22
5.6.280.0030.07721.12
5.6.210.0100.08320.61
5.6.200.0070.07718.18
5.6.190.0030.09320.33
5.6.180.0300.06320.52
5.6.170.0370.07720.46
5.6.160.0100.05720.50
5.6.150.0070.04318.25
5.6.140.0030.04018.17
5.6.130.0030.04018.13
5.6.120.0070.04021.00
5.6.110.0130.07320.99
5.6.100.0170.07320.89
5.6.90.0130.07720.98
5.6.80.0100.03720.54
5.5.350.0230.07720.39
5.5.340.0030.05717.96
5.5.330.0070.08020.29
5.5.320.0270.05020.51
5.5.310.0230.06320.34
5.5.300.0170.07017.96
5.5.290.0070.03717.92
5.5.280.0030.09020.81
5.5.270.0100.05020.75
5.5.260.0070.08320.80
5.5.250.0100.03320.62
5.5.240.0300.05720.36
5.4.450.0030.04719.49
5.4.440.0030.04019.48
5.4.430.0000.04319.41
5.4.420.0070.03719.26
5.4.410.0070.04719.07
5.4.400.0130.03019.25
5.4.390.0070.05018.98
5.4.380.0130.07319.24
5.4.370.0030.05718.96
5.4.360.0030.07318.93
5.4.350.0070.05319.24
5.4.340.0130.06719.23
5.4.320.0030.04018.86
5.4.310.0030.05719.11
5.4.300.0000.04319.14
5.4.290.0000.08018.97
5.4.280.0030.08018.92
5.4.270.0130.04319.14
5.4.260.0130.03319.16
5.4.250.0000.04718.91
5.4.240.0130.05719.00
5.4.230.0030.07018.97
5.4.220.0000.05319.07
5.4.210.0030.06019.20
5.4.200.0070.03719.07
5.4.190.0170.06318.86
5.4.180.0100.07319.23
5.4.170.0070.04018.86
5.4.160.0130.07019.14
5.4.150.0030.04319.13
5.4.140.0170.06716.48
5.4.130.0000.04716.42
5.4.120.0030.06316.45
5.4.110.0030.03716.34
5.4.100.0000.05716.30
5.4.90.0030.04016.43
5.4.80.0030.03716.49
5.4.70.0100.04316.27
5.4.60.0070.03316.47
5.4.50.0070.07016.25
5.4.40.0100.06016.27
5.4.30.0070.06316.42
5.4.20.0070.03716.40
5.4.10.0030.03716.66
5.4.00.0000.03715.77
5.3.290.0070.04714.72
5.3.280.0100.05314.65
5.3.270.0000.04314.60
5.3.260.0070.04714.66
5.3.250.0030.08014.66
5.3.240.0170.07014.63
5.3.230.0030.04014.63
5.3.220.0100.07014.46
5.3.210.0100.03314.45
5.3.200.0070.03714.60
5.3.190.0000.07314.60
5.3.180.0030.03714.55
5.3.170.0100.07014.62
5.3.160.0070.05014.48
5.3.150.0000.04314.73
5.3.140.0070.04314.63
5.3.130.0030.03714.44
5.3.120.0030.05014.62
5.3.110.0100.04014.54
5.3.100.0000.04314.03
5.3.90.0100.03013.94
5.3.80.0070.03014.01
5.3.70.0000.04013.94
5.3.60.0030.04014.01
5.3.50.0230.02714.03
5.3.40.0000.04014.00
5.3.30.0000.03713.93
5.3.20.0030.05013.68
5.3.10.0030.03313.61
5.3.00.0030.03313.64
5.2.170.0030.03311.20
5.2.160.0000.03011.10
5.2.150.0030.03011.12
5.2.140.0070.02311.22
5.2.130.0000.03011.26
5.2.120.0030.02711.25
5.2.110.0000.03011.27
5.2.100.0030.03311.12
5.2.90.0100.02011.07
5.2.80.0000.03011.06
5.2.70.0070.02311.25
5.2.60.0030.02711.05
5.2.50.0000.03010.96
5.2.40.0030.02711.05
5.2.30.0130.02310.92
5.2.20.0000.03311.12
5.2.10.0000.03011.02
5.2.00.0000.03010.76
5.1.60.0000.02310.06
5.1.50.0030.0239.97
5.1.40.0000.0279.93
5.1.30.0030.02310.23
5.1.20.0000.02710.37
5.1.10.0000.02710.03
5.1.00.0000.02710.05
5.0.50.0030.0208.55
5.0.40.0000.0208.47
5.0.30.0000.0308.21
5.0.20.0000.0208.28
5.0.10.0030.0238.14
5.0.00.0000.0308.15
4.4.90.0030.0137.37
4.4.80.0030.0177.37
4.4.70.0000.0177.37
4.4.60.0000.0177.37
4.4.50.0000.0137.37
4.4.40.0000.0277.37
4.4.30.0000.0177.37
4.4.20.0000.0207.37
4.4.10.0030.0137.37
4.4.00.0000.0237.37
4.3.110.0000.0177.37
4.3.100.0000.0177.40
4.3.90.0030.0137.41
4.3.80.0000.0237.42
4.3.70.0000.0137.42
4.3.60.0000.0137.43
4.3.50.0000.0137.43
4.3.40.0000.0237.43
4.3.30.0030.0207.44
4.3.20.0000.0237.45
4.3.10.0100.0207.45
4.3.00.0030.0307.45

preferences:
66.57 ms | 400 KiB | 5 Q