3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myfunc($iter, $item) { $item = str_replace($iter[0],$iter[1],$item); return $item; } $a = array([',',''],['\n',"\n"]); $str = '1,2,3\n,4,5,6,\n,7,8,9'; var_dump(array_reduce($a, "myfunc", $str));

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.0110.00416.38
8.3.50.0130.00921.91
8.3.40.0070.00718.70
8.3.30.0100.00318.92
8.3.20.0130.00320.33
8.3.10.0050.00223.48
8.3.00.0040.00417.92
8.2.180.0120.00916.50
8.2.170.0070.00722.96
8.2.160.0070.00720.11
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0000.00820.63
8.2.110.0180.00721.06
8.2.100.0120.00018.19
8.2.90.0080.00019.18
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0000.00918.03
8.2.50.0040.00418.07
8.2.40.0080.00019.87
8.2.30.0000.00918.04
8.2.20.0060.00317.65
8.2.10.0040.00418.05
8.2.00.0040.00417.68
8.1.280.0100.00725.92
8.1.270.0040.00422.02
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0100.00020.91
8.1.230.0040.00718.89
8.1.220.0080.00317.78
8.1.210.0000.00818.77
8.1.200.0050.00317.35
8.1.190.0090.00017.35
8.1.180.0000.00818.10
8.1.170.0040.00418.51
8.1.160.0000.00818.88
8.1.150.0000.00718.71
8.1.140.0000.00717.30
8.1.130.0000.00717.75
8.1.120.0000.00717.46
8.1.110.0050.00217.43
8.1.100.0000.00817.25
8.1.90.0000.00717.44
8.1.80.0030.00517.29
8.1.70.0040.00417.22
8.1.60.0000.00817.57
8.1.50.0040.00417.41
8.1.40.0030.00517.43
8.1.30.0080.00017.61
8.1.20.0040.00417.41
8.1.10.0040.00417.59
8.1.00.0040.00417.51
8.0.300.0030.00518.77
8.0.290.0030.00516.63
8.0.280.0000.00718.32
8.0.270.0000.00717.11
8.0.260.0000.00617.19
8.0.250.0050.00216.77
8.0.240.0000.00816.92
8.0.230.0000.00716.84
8.0.220.0000.00816.69
8.0.210.0000.00616.69
8.0.200.0000.00616.93
8.0.190.0050.00516.87
8.0.180.0000.00716.74
8.0.170.0000.00816.87
8.0.160.0070.00016.80
8.0.150.0030.00316.76
8.0.140.0040.00416.82
8.0.130.0030.00313.26
8.0.120.0040.00416.70
8.0.110.0040.00416.84
8.0.100.0040.00416.86
8.0.90.0040.00416.71
8.0.80.0100.01016.82
8.0.70.0000.00716.89
8.0.60.0040.00416.80
8.0.50.0000.00816.88
8.0.30.0080.01116.96
8.0.20.0080.01017.40
8.0.10.0040.00416.85
8.0.00.0130.00816.74
7.4.330.0000.00515.14
7.4.320.0030.00316.45
7.4.300.0000.00616.45
7.4.290.0030.00616.38
7.4.280.0040.00416.47
7.4.270.0030.00316.34
7.4.260.0040.00416.56
7.4.250.0000.00716.52
7.4.240.0020.00516.47
7.4.230.0030.00316.33
7.4.220.0130.00716.50
7.4.210.0100.00716.45
7.4.200.0000.00716.25
7.4.160.0140.00316.46
7.4.150.0130.00717.40
7.4.140.0110.00617.86
7.4.130.0100.01016.40
7.4.120.0090.01216.61
7.4.110.0130.00616.33
7.4.100.0070.01016.34
7.4.90.0100.00716.44
7.4.80.0120.00919.39
7.4.70.0070.01016.41
7.4.60.0060.01616.50
7.4.50.0000.00916.21
7.4.40.0100.00716.34
7.4.30.0060.01616.55
7.4.00.0040.01114.52
7.3.330.0000.00613.16
7.3.320.0050.00013.07
7.3.310.0030.00316.21
7.3.300.0040.00416.16
7.3.290.0060.00916.23
7.3.280.0110.00616.25
7.3.270.0090.00917.40
7.3.260.0170.00016.44
7.3.250.0110.01016.53
7.3.240.0080.00816.57
7.3.230.0040.01516.39
7.3.210.0120.00416.38
7.3.200.0050.01319.39
7.3.190.0070.01016.31
7.3.180.0050.01116.43
7.3.170.0100.00716.31
7.3.160.0140.00716.29
7.2.330.0120.01316.71
7.2.320.0140.00716.72
7.2.310.0080.01316.33
7.2.300.0080.00816.63
7.2.290.0100.01316.37
7.2.60.0060.01016.87
7.2.00.0070.00719.30
7.1.200.0060.00615.45
7.1.100.0040.01118.00
7.1.70.0060.00317.02
7.1.60.0110.01419.29
7.1.50.0030.01416.59
7.1.00.0070.07322.36
7.0.200.0430.00714.82
7.0.140.0030.07321.95
7.0.60.0130.07721.82
7.0.50.0100.05017.86
7.0.40.0100.06020.15
7.0.30.0630.06020.17
7.0.20.0330.08020.05
7.0.10.0170.04020.24
7.0.00.0070.08720.23
5.6.280.0070.07020.83
5.6.210.0100.08020.75
5.6.200.0030.04318.29
5.6.190.0030.04320.57
5.6.180.0100.05320.48
5.6.170.0170.04320.52
5.6.160.0070.04020.48
5.6.150.0100.04718.18
5.6.140.0100.06318.14
5.6.130.0070.05018.18
5.6.120.0030.04321.13
5.6.110.0030.08721.13
5.6.100.0070.08320.98
5.6.90.0030.08021.08
5.6.80.0130.06720.41
5.5.350.0170.04720.46
5.5.340.0070.08017.96
5.5.330.0030.04020.35
5.5.320.0270.04320.34
5.5.310.0370.07020.34
5.5.300.0070.05717.93
5.5.290.0030.04017.98
5.5.280.0030.04020.80
5.5.270.0100.06720.88
5.5.260.0070.07020.95
5.5.250.0070.08020.75
5.5.240.0300.04720.02
5.4.450.0530.06019.63
5.4.440.0170.05319.64
5.4.430.0100.05319.42
5.4.420.0100.06719.43
5.4.410.0200.04719.56
5.4.400.0130.05719.21
5.4.390.0130.05319.04
5.4.380.0270.05018.58
5.4.370.0170.03318.51
5.4.360.0100.05018.65
5.4.350.0070.04718.74
5.4.340.0000.05318.58
5.4.320.0030.04318.40
5.4.310.0000.04718.63
5.4.300.0200.03318.50
5.4.290.0100.03318.37
5.4.280.0070.04018.63
5.4.270.0030.04318.68
5.4.260.0270.03018.62
5.4.250.0130.05018.74
5.4.240.0030.04718.50
5.4.230.0070.04018.71
5.4.220.0030.05718.49
5.4.210.0130.04318.39
5.4.200.0000.04316.45
5.4.190.0100.04018.36
5.4.180.0030.04318.71
5.4.170.0170.04718.61
5.4.160.0030.04318.36
5.4.150.0130.03318.71
5.4.140.0100.04016.21
5.4.130.0100.03316.24
5.4.120.0100.03016.32
5.4.110.0070.04316.20
5.4.100.0000.05316.37
5.4.90.0100.03316.19
5.4.80.0100.03316.24
5.4.70.0100.03316.18
5.4.60.0030.04016.08
5.4.50.0130.03016.32
5.4.40.0070.03716.17
5.4.30.0100.03716.17
5.4.20.0030.04316.19
5.4.10.0230.03316.23
5.4.00.0170.05015.63
5.3.290.0070.04714.73
5.3.280.0130.03314.64
5.3.270.0030.05014.60
5.3.260.0130.04014.52
5.3.250.0100.03714.74
5.3.240.0100.03714.63
5.3.230.0070.04014.74
5.3.220.0230.03714.71
5.3.210.0000.05314.50
5.3.200.0130.03714.54
5.3.190.0130.04014.61
5.3.180.0070.05714.59
5.3.170.0100.05014.72
5.3.160.0100.05314.67
5.3.150.0070.04014.52
5.3.140.0170.03014.53
5.3.130.0200.03314.61
5.3.120.0200.04014.61
5.3.110.0170.05714.52
5.3.100.0100.05014.16
5.3.90.0100.05313.99
5.3.80.0100.04714.01
5.3.70.0070.05014.16
5.3.60.0100.05013.88
5.3.50.0200.04313.92
5.3.40.0070.05314.01
5.3.30.0170.04313.98
5.3.20.0130.05313.73
5.3.10.0170.04313.75
5.3.00.0170.04013.68
5.2.170.0030.04011.28
5.2.160.0170.03011.18
5.2.150.0070.04011.13
5.2.140.0130.03711.29
5.2.130.0070.03711.21
5.2.120.0070.03711.16
5.2.110.0130.02711.02
5.2.100.0130.03711.17
5.2.90.0130.03711.09
5.2.80.0130.04711.03
5.2.70.0100.04011.13
5.2.60.0070.03710.97
5.2.50.0130.03011.08
5.2.40.0070.03311.15
5.2.30.0000.03710.90
5.2.20.0130.02311.00
5.2.10.0030.03310.84
5.2.00.0130.02710.63
5.1.60.0130.02710.07
5.1.50.0130.03010.05
5.1.40.0100.04010.15
5.1.30.0070.03710.31
5.1.20.0130.03310.42
5.1.10.0100.04010.11
5.1.00.0130.03310.01
5.0.50.0000.0308.53
5.0.40.0070.0278.39
5.0.30.0070.0408.35
5.0.20.0130.0278.26
5.0.10.0030.0278.15
5.0.00.0070.0408.14
4.4.90.0170.0105.83
4.4.80.0100.0175.89
4.4.70.0000.0205.98
4.4.60.0000.0205.82
4.4.50.0030.0175.84
4.4.40.0030.0305.94
4.4.30.0100.0135.93
4.4.20.0030.0235.89
4.4.10.0000.0205.96
4.4.00.0100.0305.89
4.3.110.0070.0205.76
4.3.100.0070.0175.79
4.3.90.0100.0235.74
4.3.80.0030.0235.86
4.3.70.0000.0175.76
4.3.60.0000.0205.72
4.3.50.0070.0135.85
4.3.40.0000.0305.69
4.3.30.0000.0204.50
4.3.20.0030.0174.48
4.3.10.0030.0174.52
4.3.00.0070.0276.98

preferences:
54.1 ms | 401 KiB | 5 Q