3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This code should loop through $data, converting null to 0. * * If it finds an array inside the data, it loops through that * converting null values to 0. * * The error'ed line throws the following PHP error which breaks the code: * ------- * PHP Warning: Cannot use a scalar value as an array * ------- */ $data = json_decode('{"last":"0.692776960","high":"0.692776960","low":"0.692776960","avg":0.6928,"vol":"0.252273837","vols":{"bid":null,"ask":null}}', true); $new_data = array_replace_recursive($data, function ($value) { if ($value === null) { return 0; } }); var_dump($new_data);

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.70.0120.00618.43
8.3.60.0090.00618.25
8.3.50.0120.00721.93
8.3.40.0170.00318.83
8.3.30.0110.00418.86
8.3.20.0070.00020.33
8.3.10.0000.00823.61
8.3.00.0040.00420.71
8.2.190.0120.00316.58
8.2.180.0060.01218.38
8.2.170.0000.01422.96
8.2.160.0070.01022.20
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0070.00022.17
8.2.110.0170.00022.25
8.2.100.0070.00417.91
8.2.90.0050.00319.05
8.2.80.0040.00417.97
8.2.70.0070.00717.25
8.2.60.0040.00417.80
8.2.50.0080.00018.07
8.2.40.0040.00419.30
8.2.30.0060.00318.12
8.2.20.0050.00317.73
8.2.10.0040.00417.81
8.2.00.0040.00417.76
8.1.280.0110.01125.92
8.1.270.0030.00723.91
8.1.260.0000.00926.35
8.1.250.0000.00728.09
8.1.240.0060.00323.82
8.1.230.0070.00418.99
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00617.35
8.1.190.0000.00817.55
8.1.180.0000.00718.10
8.1.170.0030.00618.45
8.1.160.0000.00721.90
8.1.150.0000.00718.54
8.1.140.0060.00317.50
8.1.130.0070.00017.79
8.1.120.0040.00417.47
8.1.110.0040.00417.53
8.1.100.0050.00317.43
8.1.90.0000.00717.43
8.1.80.0030.00517.45
8.1.70.0000.00717.39
8.1.60.0090.00017.54
8.1.50.0000.00817.49
8.1.40.0070.00017.51
8.1.30.0050.00317.73
8.1.20.0070.00317.57
8.1.10.0040.00417.59
8.1.00.0050.00317.46
8.0.300.0040.00418.77
8.0.290.0000.00717.05
8.0.280.0030.00318.26
8.0.270.0000.00717.19
8.0.260.0030.00316.75
8.0.250.0030.00316.94
8.0.240.0030.00316.92
8.0.230.0030.00316.98
8.0.220.0000.00816.82
8.0.210.0030.00316.94
8.0.200.0060.00017.08
8.0.190.0000.00817.00
8.0.180.0050.00216.98
8.0.170.0070.00016.86
8.0.160.0000.00917.01
8.0.150.0000.00716.89
8.0.140.0040.00416.88
8.0.130.0030.00313.40
8.0.120.0040.00416.87
8.0.110.0040.00417.00
8.0.100.0080.00016.99
8.0.90.0020.00516.87
8.0.80.0040.01116.96
8.0.70.0040.00416.90
8.0.60.0020.00516.87
8.0.50.0000.01016.73
8.0.30.0090.01016.95
8.0.20.0140.00417.40
8.0.10.0000.00716.95
8.0.00.0100.00816.72
7.4.330.0000.00515.00
7.4.320.0000.00716.56
7.4.300.0060.00016.42
7.4.290.0030.00316.51
7.4.280.0040.00416.61
7.4.270.0040.00416.41
7.4.260.0000.00616.58
7.4.250.0070.00016.47
7.4.240.0000.00716.58
7.4.230.0040.00416.58
7.4.220.0060.01216.69
7.4.210.0070.01316.62
7.4.200.0030.00316.61
7.4.190.0030.00316.68
7.4.160.0030.01316.38
7.4.150.0100.01417.40
7.4.140.0100.01017.86
7.4.130.0080.00916.55
7.4.120.0120.00916.49
7.4.110.0090.00816.52
7.4.100.0110.00616.55
7.4.90.0130.00316.55
7.4.80.0130.01016.33
7.4.70.0060.00916.54
7.4.60.0060.01016.26
7.4.50.0000.00716.48
7.4.40.0070.01122.77
7.4.30.0100.01016.72
7.4.00.0040.00815.09
7.3.330.0050.00013.29
7.3.320.0030.00313.26
7.3.310.0070.00016.18
7.3.300.0000.00616.14
7.3.290.0110.00416.31
7.3.280.0090.00616.28
7.3.270.0040.01217.40
7.3.260.0120.00916.30
7.3.250.0140.00316.31
7.3.240.0130.00316.46
7.3.230.0100.00716.53
7.3.210.0110.00816.34
7.3.200.0090.00619.39
7.3.190.0150.00316.36
7.3.180.0040.01316.26
7.3.170.0120.00316.35
7.3.160.0150.00916.44
7.3.120.0090.00614.52
7.2.330.0100.00716.64
7.2.320.0090.00916.46
7.2.310.0000.01716.48
7.2.300.0080.01616.28
7.2.290.0030.01316.50
7.2.60.0090.00316.73
7.2.00.0090.00619.40
7.1.200.0000.01215.79
7.1.100.0080.00318.16
7.1.70.0000.00816.93
7.1.60.0160.01019.29
7.1.50.0180.00716.90
7.1.00.0030.07322.35
7.0.200.0070.00716.68
7.0.140.0070.07022.11
7.0.60.0070.03719.86
7.0.50.0070.04717.90
7.0.40.0070.05320.30
7.0.30.0300.06720.08
7.0.20.0270.04720.19
7.0.10.0100.05320.23
7.0.00.0200.04020.24
5.6.280.0070.07021.11
5.6.210.0070.07320.51
5.6.200.0070.08318.29
5.6.190.0170.07020.63
5.6.180.0470.05320.48
5.6.170.0400.07720.59
5.6.160.0130.07720.50
5.6.150.0030.07318.12
5.6.140.0070.07318.18
5.6.130.0130.04718.16
5.6.120.0170.04321.14
5.6.110.0000.04321.09
5.6.100.0100.08721.11
5.6.90.0030.08721.00
5.6.80.0070.07720.39
5.5.350.0230.06720.39
5.5.340.0030.05717.98
5.5.330.0100.04020.32
5.5.320.0370.04720.27
5.5.310.0330.06720.30
5.5.300.0170.07017.95
5.5.290.0070.06318.01
5.5.280.0130.08020.96
5.5.270.0100.03720.75
5.5.260.0100.05020.77
5.5.250.0100.08020.66
5.5.240.0200.06720.36
5.4.450.0800.04319.58
5.4.440.0570.06319.25
5.4.430.0100.05319.37
5.4.420.0130.05319.54
5.4.410.0230.05018.70
5.4.400.0100.05718.89
5.4.390.0070.05318.84
5.4.380.0270.04318.70
5.4.370.0170.06318.76
5.4.360.0130.05318.75
5.4.350.0100.06018.53
5.4.340.0130.08018.56
5.4.320.0060.04712.51
5.4.310.0090.04312.50
5.4.300.0030.03812.51
5.4.290.0030.04212.50
5.4.280.0060.04112.37
5.4.270.0070.04212.37
5.4.260.0090.04812.36
5.4.250.0280.10812.37
5.4.240.0100.05212.37
5.4.230.0170.03312.36
5.4.220.0150.05012.36
5.4.210.0080.04012.36
5.4.200.0070.04712.36
5.4.190.0080.04212.36
5.4.180.0130.03612.36
5.4.170.0050.04212.36
5.4.160.0070.04012.36
5.4.150.0030.04912.36
5.4.140.0390.07212.04
5.4.130.0100.03612.03
5.4.120.0070.03811.99
5.4.110.0100.03811.98
5.4.100.0060.04111.98
5.4.90.0050.04211.99
5.4.80.0080.03911.98
5.4.70.0090.03611.98
5.4.60.0040.04011.98
5.4.50.0060.04011.98
5.4.40.0080.03711.97
5.4.30.0070.04311.96
5.4.20.0180.06211.97
5.4.10.0090.03911.96
5.4.00.0060.03911.46
5.3.290.0070.03812.80
5.3.280.0090.04212.71
5.3.270.0080.04612.72
5.3.260.0070.04412.72
5.3.250.0100.03912.72
5.3.240.0090.03912.72
5.3.230.0100.04012.71
5.3.220.0110.04012.68
5.3.210.0110.04212.68
5.3.200.0070.03912.68
5.3.190.0050.04712.67
5.3.180.0090.04912.67
5.3.170.0070.04012.67
5.3.160.0120.04512.68
5.3.150.0150.06512.67
5.3.140.0530.14912.66
5.3.130.0090.04412.66
5.3.120.0160.05712.66
5.3.110.0110.05412.66
5.3.100.0100.05412.12
5.3.90.0290.07812.09
5.3.80.0080.03512.07
5.3.70.0070.03712.07
5.3.60.0040.04012.07
5.3.50.0110.04012.00
5.3.40.0140.04512.00
5.3.30.0060.03711.95
5.3.20.0080.03811.73
5.3.10.0180.05511.70
5.3.00.0070.03711.69
5.2.170.0080.0309.15
5.2.160.0050.0329.15
5.2.150.0060.0419.15
5.2.140.0090.0379.15
5.2.130.0060.0389.11
5.2.120.0070.0349.11
5.2.110.0180.0459.11
5.2.100.0070.0379.11
5.2.90.0090.0389.11
5.2.80.0070.0329.11
5.2.70.0060.0299.10
5.2.60.0050.0419.06
5.2.50.0030.0339.04
5.2.40.0060.0299.01
5.2.30.0060.0298.99
5.2.20.0080.0278.97
5.2.10.0040.0318.90
5.2.00.0070.0298.77
5.1.60.0090.0258.05
5.1.50.0070.0328.05
5.1.40.0070.0678.03
5.1.30.0060.0268.38
5.1.20.0080.0528.39
5.1.10.0070.0358.13
5.1.00.0100.0508.13
5.0.50.0130.0366.60
5.0.40.0100.0276.47
5.0.30.0050.0396.27
5.0.20.0040.0276.25
5.0.10.0100.0326.23
5.0.00.0050.0376.22
4.4.90.0040.0214.78
4.4.80.0070.0204.75
4.4.70.0040.0214.75
4.4.60.0080.0174.75
4.4.50.0050.0184.77
4.4.40.0020.0304.71
4.4.30.0060.0264.76
4.4.20.0040.0184.84
4.4.10.0060.0174.85
4.4.00.0050.0304.76
4.3.110.0040.0194.66
4.3.100.0060.0164.67
4.3.90.0060.0154.63
4.3.80.0070.0254.59
4.3.70.0030.0194.63
4.3.60.0040.0164.63
4.3.50.0030.0174.63
4.3.40.0020.0274.54
4.3.30.0050.0193.27
4.3.20.0060.0183.25
4.3.10.0020.0183.22
4.3.00.0200.0236.97

preferences:
40.38 ms | 401 KiB | 5 Q