3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "key1"=>"value1", "key2"=>null, "key3"=>array( "subkey1"=>null, "subkey2"=>"subvalue2"), "key4"=>null); echo json_encode(replace_null_with_empty_string($arr)); function replace_null_with_empty_string($array) { foreach ($array as $key => $value) { if(is_array($value)) $array[$key] = replace_null_with_empty_string($value); else { if (is_null($value)) $array[$key] = ""; } } return $array; }

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.4.10.0070.00317.93
8.3.140.0030.00616.97
8.3.130.0080.00018.35
8.3.120.0090.00020.63
8.3.110.0160.00316.53
8.3.100.0120.00324.06
8.3.90.0060.00326.77
8.3.80.0060.00316.63
8.3.70.0170.00316.75
8.3.60.0100.00718.16
8.3.50.0110.00721.97
8.3.40.0100.00318.70
8.3.30.0000.01418.55
8.3.20.0040.00420.16
8.3.10.0080.00023.65
8.3.00.0100.00017.75
8.2.250.0080.00018.41
8.2.240.0180.00017.49
8.2.230.0100.01020.94
8.2.220.0160.00337.54
8.2.210.0040.00426.77
8.2.200.0090.00016.75
8.2.190.0100.01017.00
8.2.180.0120.00616.63
8.2.170.0110.00322.96
8.2.160.0080.00520.35
8.2.150.0120.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0070.00417.89
8.2.110.0030.00620.39
8.2.100.0040.00817.84
8.2.90.0080.00018.16
8.2.80.0060.00319.95
8.2.70.0100.00017.63
8.2.60.0090.00017.63
8.2.50.0000.00918.07
8.2.40.0030.00517.93
8.2.30.0080.00018.01
8.2.20.0100.00017.88
8.2.10.0000.00718.05
8.2.00.0070.00018.20
8.1.300.0090.00016.29
8.1.290.0030.00618.88
8.1.280.0130.00325.92
8.1.270.0060.00321.94
8.1.260.0050.00228.09
8.1.250.0050.00228.09
8.1.240.0090.00023.84
8.1.230.0050.00520.87
8.1.220.0030.00617.78
8.1.210.0000.00818.77
8.1.200.0050.00317.48
8.1.190.0000.00817.13
8.1.180.0040.00418.10
8.1.170.0040.00417.62
8.1.160.0040.00418.91
8.1.150.0000.00720.71
8.1.140.0000.00719.52
8.1.130.0030.00319.15
8.1.120.0030.00517.43
8.1.110.0000.00817.43
8.1.100.0050.00217.45
8.1.90.0040.00417.38
8.1.80.0000.00717.45
8.1.70.0000.00717.35
8.1.60.0060.00317.61
8.1.50.0090.00017.53
8.1.40.0070.00317.42
8.1.30.0080.00017.66
8.1.20.0000.00817.50
8.1.10.0040.00417.51
8.1.00.0080.00017.52
8.0.300.0030.00620.02
8.0.290.0080.00016.75
8.0.280.0030.00318.57
8.0.270.0040.00416.77
8.0.260.0000.00617.26
8.0.250.0060.00316.87
8.0.240.0000.00716.88
8.0.230.0030.00616.83
8.0.220.0050.00216.84
8.0.210.0040.00416.78
8.0.200.0000.00716.95
8.0.190.0030.00516.93
8.0.180.0050.00216.82
8.0.170.0040.00416.86
8.0.160.0000.00716.88
8.0.150.0070.00016.73
8.0.140.0070.00016.89
8.0.130.0030.00313.29
8.0.120.0040.00416.92
8.0.110.0020.00516.87
8.0.100.0070.00016.97
8.0.90.0000.00816.73
8.0.80.0140.00716.89
8.0.70.0040.00416.80
8.0.60.0040.00416.89
8.0.50.0080.00016.75
8.0.30.0100.00817.31
8.0.20.0070.01317.40
8.0.10.0040.00417.05
8.0.00.0130.01016.77
7.4.330.0000.00515.08
7.4.320.0000.00616.52
7.4.300.0030.00316.60
7.4.290.0000.00716.46
7.4.280.0040.00716.51
7.4.270.0000.00716.59
7.4.260.0000.00716.57
7.4.250.0000.00716.57
7.4.240.0030.00416.56
7.4.230.0000.00716.59
7.4.220.0060.01916.66
7.4.210.0050.00916.57
7.4.200.0040.00416.59
7.4.160.0090.00916.67
7.4.150.0060.01317.40
7.4.140.0050.01217.86
7.4.130.0110.00716.49
7.4.120.0100.00716.43
7.4.110.0140.00816.61
7.4.100.0060.01116.53
7.4.90.0120.00516.57
7.4.80.0070.01017.89
7.4.70.0110.00616.55
7.4.60.0140.00516.42
7.4.50.0090.00716.48
7.4.40.0120.00916.61
7.4.30.0080.01016.53
7.4.20.0190.00616.53
7.4.10.0100.01016.41
7.4.00.0080.00815.27
7.3.330.0060.00013.34
7.3.320.0020.00213.39
7.3.310.0030.00316.45
7.3.300.0030.00316.37
7.3.290.0000.00716.33
7.3.280.0110.00816.38
7.3.270.0070.01017.40
7.3.260.0080.00816.37
7.3.250.0120.00616.38
7.3.240.0090.00916.42
7.3.230.0120.00816.47
7.3.220.0120.00616.45
7.3.210.0110.00616.62
7.3.200.0090.00816.29
7.3.190.0100.00816.54
7.3.180.0100.00816.48
7.3.170.0070.01216.37
7.3.160.0100.00716.47
7.3.150.0120.00816.65
7.3.140.0090.00916.32
7.3.130.0040.01416.27
7.3.120.0080.00915.36
7.3.110.0060.01215.31
7.3.100.0060.01015.16
7.3.90.0060.00915.06
7.3.80.0080.00815.04
7.3.70.0060.01115.10
7.3.60.0050.01115.11
7.3.50.0100.00614.92
7.3.40.0060.00915.08
7.3.30.0110.00515.00
7.3.20.0330.00615.56
7.3.10.0660.00715.65
7.3.00.0690.00915.67
7.2.340.0120.01216.46
7.2.330.0130.00716.54
7.2.320.0090.01116.72
7.2.310.0110.00916.47
7.2.300.0130.00716.50
7.2.290.0110.00616.74
7.2.280.0090.01216.69
7.2.270.0170.00716.70
7.2.260.0110.00716.60
7.2.250.0100.00715.67
7.2.240.0070.01215.38
7.2.230.0060.01015.47
7.2.220.0080.00815.32
7.2.210.0090.00715.34
7.2.200.0090.00715.28
7.2.190.0080.00915.20
7.2.180.0080.00815.26
7.2.170.0090.00715.20
7.2.160.0070.01215.26
7.2.150.0780.00615.59
7.2.140.0370.00615.60
7.2.130.1350.01115.69
7.2.120.1250.00815.53
7.2.110.0810.00815.44
7.2.100.0850.00915.45
7.2.90.0550.01115.54
7.2.80.0580.01015.45
7.2.70.0500.00815.43
7.2.60.0590.00815.70
7.2.50.0580.00915.50
7.2.40.0570.00615.53
7.2.30.0450.00915.45
7.2.20.0400.01415.55
7.2.10.0370.00715.52
7.2.00.0410.00415.53
7.1.330.0080.01015.23
7.1.320.0080.00814.93
7.1.310.0070.01115.00
7.1.300.0080.00714.92
7.1.290.0210.00814.98
7.1.280.0080.00714.95
7.1.270.0290.00714.73
7.1.260.0970.00714.69
7.1.250.1790.01014.56
7.1.240.0820.01014.51
7.1.230.0870.00914.40
7.1.220.0780.00914.56
7.1.210.0600.00714.40
7.1.200.0530.00914.50
7.1.190.0440.00814.37
7.1.180.0550.00714.41
7.1.170.0490.01014.38
7.1.160.0520.00914.36
7.1.150.0440.00814.44
7.1.140.0360.00714.38
7.1.130.0430.00514.34
7.1.120.0400.00814.38
7.1.110.0270.00814.55
7.1.100.0330.00714.47
7.1.90.0380.01014.37
7.1.80.0270.00914.40
7.1.70.0240.00714.82
7.1.60.0250.00917.38
7.1.50.0260.01017.38
7.1.40.0260.00717.27
7.1.30.0300.00617.52
7.1.20.0200.00917.57
7.1.10.0240.00414.93
7.1.00.0200.00614.96
7.0.330.0570.00914.02
7.0.320.1040.00913.95
7.0.310.0680.00913.87
7.0.300.0710.00713.87
7.0.290.0590.01113.87
7.0.280.0460.00913.79
7.0.270.0770.00613.91
7.0.260.0510.01113.91
7.0.250.0430.00613.95
7.0.240.0220.01413.95
7.0.230.0420.00713.89
7.0.220.0380.00713.91
7.0.210.0360.00613.99
7.0.200.0300.00514.40
7.0.190.0300.00714.37
7.0.180.0260.00714.30
7.0.170.0220.01114.38
7.0.160.0260.00614.68
7.0.150.0270.00614.60
7.0.140.0240.00714.62
7.0.130.0190.00614.61
7.0.120.0260.00814.34
7.0.110.0350.00614.19
7.0.100.0210.00914.23
7.0.90.0220.00814.36
7.0.80.0200.00814.30
7.0.70.0220.00614.35
7.0.60.0240.00814.22
7.0.50.0250.00614.36
7.0.40.0230.00714.13
7.0.30.0210.01014.05
7.0.20.0210.00714.01
7.0.10.0260.00713.97
7.0.00.0260.00914.10
5.6.400.0150.00914.93
5.6.390.0120.00814.62
5.6.380.0110.00814.54
5.6.370.0150.00714.73
5.6.360.0150.00814.67
5.6.350.0130.01514.67
5.6.340.0160.01114.67
5.6.330.0110.01114.65
5.6.320.0120.00814.80
5.6.310.0160.00914.55
5.6.300.0120.01715.76
5.6.290.0130.01515.71
5.6.280.0090.01915.79
5.6.270.0120.01615.74
5.6.260.0090.01815.72
5.6.250.0120.01315.67
5.6.240.0120.01515.80
5.6.230.0120.01515.71
5.6.220.0150.01515.61
5.6.210.0140.02215.75
5.6.200.0120.01615.68
5.6.190.0120.01515.67
5.6.180.0120.01415.65
5.6.170.0160.01715.67
5.6.160.0130.01515.67
5.6.150.0140.01615.68
5.6.140.0120.01715.71
5.6.130.0120.01515.66
5.6.120.0150.01615.77
5.6.110.0150.01215.69
5.6.100.0140.01715.60
5.6.90.0130.01515.64
5.6.80.0120.01315.55
5.6.70.0100.01315.45
5.6.60.0100.01715.54
5.6.50.0120.01415.48
5.6.40.0130.01315.58
5.6.30.0090.01615.58
5.6.20.0130.01815.47
5.6.10.0120.01315.63
5.6.00.0130.01115.45
5.5.380.0120.01614.61
5.5.370.0110.01514.54
5.5.360.0170.01114.51
5.5.350.0100.01714.56
5.5.340.0140.01414.56
5.5.330.0100.01514.62
5.5.320.0130.01414.71
5.5.310.0130.01614.71
5.5.300.0120.01514.77
5.5.290.0120.01514.53
5.5.280.0110.01714.63
5.5.270.0100.01614.66
5.5.260.0120.01314.61
5.5.250.0120.01414.49
5.5.240.0140.01514.41
5.5.230.0120.01514.38
5.5.220.0110.01414.44
5.5.210.0120.01314.45
5.5.200.0110.01314.37
5.5.190.0140.01214.41
5.5.180.0140.01914.52
5.5.170.0170.00514.55
5.5.160.0130.01214.49
5.5.150.0140.01414.48
5.5.140.0160.00914.49
5.5.130.0110.01414.54
5.5.120.0130.01414.53
5.5.110.0150.01114.57
5.5.100.0120.01514.40
5.5.90.0120.01214.54
5.5.80.0110.01214.41
5.5.70.0110.01814.49
5.5.60.0110.01214.59
5.5.50.0110.01414.53
5.5.40.0100.01614.53
5.5.30.0070.01814.48
5.5.20.0100.01314.50
5.5.10.0090.01714.42
5.5.00.0120.01214.52
5.4.450.0140.00912.89
5.4.440.0170.00512.86
5.4.430.0190.00412.98
5.4.420.0120.01212.82
5.4.410.0170.00612.82
5.4.400.0230.00012.82
5.4.390.0220.00312.83
5.4.380.0180.00712.88
5.4.370.0140.01412.82
5.4.360.0160.00812.82
5.4.350.0190.00512.93
5.4.340.0140.00712.82
5.4.330.0120.00913.01
5.4.320.0220.00012.82
5.4.310.0160.00812.82
5.4.300.0150.00912.82
5.4.290.0120.01212.83
5.4.280.0160.00712.83
5.4.270.0130.01012.82
5.4.260.0200.00312.85
5.4.250.0150.00712.82
5.4.240.0130.00912.96
5.4.230.0080.01712.84
5.4.220.0280.00012.96
5.4.210.0190.00312.82
5.4.200.0090.01312.82
5.4.190.0150.01112.82
5.4.180.0210.00012.82
5.4.170.0120.00912.82
5.4.160.0150.00812.92
5.4.150.0190.00312.82
5.4.140.0110.01112.89
5.4.130.0090.01312.82
5.4.120.0170.00712.98
5.4.110.0140.01412.83
5.4.100.0070.01412.82
5.4.90.0150.00612.82
5.4.80.0120.00812.97
5.4.70.0130.00712.83
5.4.60.0180.00312.82
5.4.50.0130.00712.82
5.4.40.0140.00712.82
5.4.30.0170.00412.96
5.4.20.0160.00612.82
5.4.10.0140.00912.86
5.4.00.0160.00512.82
5.3.290.0150.01013.09
5.3.280.0110.01212.98
5.3.270.0170.00713.11
5.3.260.0130.01013.11
5.3.250.0240.00013.09
5.3.240.0150.00812.94
5.3.230.0190.00412.95
5.3.220.0190.01013.13
5.3.210.0180.00613.11
5.3.200.0250.00013.10
5.3.190.0050.01613.17
5.3.180.0170.00613.24
5.3.170.0170.00613.11
5.3.160.0140.00813.23
5.3.150.0060.01813.25
5.3.140.0130.01013.28
5.3.130.0170.00913.14
5.3.120.0130.01013.24
5.3.110.0220.00613.09
5.3.100.0190.00413.39
5.3.90.0130.00913.08
5.3.80.0090.01413.04
5.3.70.0150.00812.96
5.3.60.0170.00613.29
5.3.50.0150.01113.14
5.3.40.0160.01213.14
5.3.30.0210.00313.09
5.3.20.0160.00512.95
5.3.10.0140.00812.82
5.3.00.0140.00812.82
5.2.170.0140.00912.82
5.2.160.0200.00012.82
5.2.150.0160.00312.82
5.2.140.0110.00812.82
5.2.130.0060.01312.82
5.2.120.0150.00712.82
5.2.110.0180.00412.82
5.2.100.0160.00612.82
5.2.90.0130.00712.82
5.2.80.0150.00412.82
5.2.70.0100.01012.82
5.2.60.0080.01212.82
5.2.50.0130.00712.82
5.2.40.0050.01412.82
5.2.30.0100.01012.82
5.2.20.0130.00512.82
5.2.10.0130.00512.82
5.2.00.0160.00512.82
5.1.60.0070.01112.82
5.1.50.0090.01012.82
5.1.40.0130.01012.82
5.1.30.0130.00812.82
5.1.20.0120.00612.82
5.1.10.0070.01012.82
5.1.00.0140.00212.82
5.0.50.0050.00812.82
5.0.40.0050.00812.82
5.0.30.0150.00012.82
5.0.20.0100.00512.82
5.0.10.0050.00912.82
5.0.00.0090.00612.82
4.4.90.0070.00412.82
4.4.80.0090.00012.82
4.4.70.0110.00012.82
4.4.60.0070.00212.82
4.4.50.0060.00312.82
4.4.40.0060.00312.82
4.4.30.0060.00312.82
4.4.20.0070.00312.82
4.4.10.0090.00012.82
4.4.00.0080.00012.82
4.3.110.0090.00012.82
4.3.100.0040.00812.82
4.3.90.0080.00212.82
4.3.80.0060.00312.82
4.3.70.0060.00312.82
4.3.60.0060.00312.82
4.3.50.0060.00312.82
4.3.40.0060.00312.82
4.3.30.0090.00012.82
4.3.20.0050.00312.82
4.3.10.0040.00412.82
4.3.00.0040.00512.82

preferences:
30.05 ms | 403 KiB | 5 Q