3v4l.org

run code in 300+ PHP versions simultaneously
<?php function square(&$n) { // Check if the item is a number if(is_numeric($n)) $n = ($n * $n); // Yes, square it else $n = "Not a number"; // No, replace with this } // Initialize the array $array = array(0, 48, 22, 90, 44, 9, 222, 'Iamzheasshole', 101); // Walk through the array, called the square function for every item array_walk($array, 'square'); // Output the array print_r($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.3.40.0090.00618.71
8.3.30.0070.00718.71
8.3.20.0050.00318.65
8.3.10.0030.00521.04
8.3.00.0040.00721.73
8.2.170.0100.00722.96
8.2.160.0070.00720.57
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0030.00521.07
8.2.110.0060.00320.52
8.2.100.0060.00617.91
8.2.90.0000.00719.17
8.2.80.0060.00317.97
8.2.70.0030.00617.50
8.2.60.0000.00717.93
8.2.50.0000.00818.07
8.2.40.0060.00318.22
8.2.30.0050.00221.18
8.2.20.0040.00417.53
8.2.10.0090.00017.63
8.2.00.0040.00417.73
8.1.270.0040.00423.99
8.1.260.0110.00426.35
8.1.250.0000.00828.09
8.1.240.0000.00922.42
8.1.230.0060.00620.89
8.1.220.0050.00318.77
8.1.210.0000.00818.77
8.1.200.0080.00017.23
8.1.190.0000.00919.42
8.1.180.0060.00318.10
8.1.170.0050.00318.52
8.1.160.0070.00018.88
8.1.150.0000.00818.64
8.1.140.0050.00217.26
8.1.130.0030.00317.83
8.1.120.0040.00417.41
8.1.110.0040.00417.44
8.1.100.0070.00017.39
8.1.90.0080.00017.43
8.1.80.0050.00217.28
8.1.70.0070.00017.30
8.1.60.0070.00317.41
8.1.50.0050.00217.29
8.1.40.0040.00417.43
8.1.30.0040.00417.48
8.1.20.0030.00617.48
8.1.10.0030.00517.54
8.1.00.0040.00417.37
8.0.300.0090.00019.98
8.0.290.0030.00617.16
8.0.280.0030.00318.46
8.0.270.0060.00317.26
8.0.260.0020.00516.78
8.0.250.0000.00716.94
8.0.240.0050.00317.00
8.0.230.0030.00316.96
8.0.220.0030.00316.70
8.0.210.0080.00016.86
8.0.200.0060.00316.79
8.0.190.0030.00316.88
8.0.180.0000.00816.76
8.0.170.0080.00016.75
8.0.160.0030.00316.84
8.0.150.0070.00016.76
8.0.140.0030.00316.81
8.0.130.0000.00513.29
8.0.120.0000.00716.68
8.0.110.0000.00816.70
8.0.100.0040.00416.79
8.0.90.0000.00716.89
8.0.80.0000.01516.82
8.0.70.0050.00216.94
8.0.60.0040.00416.87
8.0.50.0000.00716.73
8.0.30.0090.00916.88
8.0.20.0120.00617.40
8.0.10.0040.00416.77
8.0.00.0060.01116.71
7.4.330.0000.00514.70
7.4.320.0040.00416.38
7.4.300.0040.00416.42
7.4.290.0000.00716.58
7.4.280.0000.00716.52
7.4.270.0030.00316.31
7.4.260.0000.00613.20
7.4.250.0020.00516.50
7.4.240.0050.00316.39
7.4.230.0050.00216.43
7.4.220.0110.01116.59
7.4.210.0060.00816.53
7.4.200.0030.00316.19
7.4.190.0000.00716.70
7.4.160.0030.01316.34
7.4.150.0120.00617.40
7.4.140.0100.00917.86
7.4.130.0180.00316.38
7.4.120.0110.00616.52
7.4.110.0040.01216.36
7.4.100.0090.01216.46
7.4.90.0060.01616.44
7.4.80.0030.01519.39
7.4.70.0030.01416.45
7.4.60.0100.00716.37
7.4.50.0050.00316.46
7.4.40.0070.01122.77
7.4.30.0100.00716.38
7.4.00.0090.00614.98
7.3.330.0000.00513.21
7.3.320.0050.00013.05
7.3.310.0030.00316.29
7.3.300.0000.00616.24
7.3.290.0070.00816.25
7.3.280.0090.00816.20
7.3.270.0060.01117.40
7.3.260.0100.01018.24
7.3.250.0080.01116.43
7.3.240.0100.00616.50
7.3.230.0060.01716.39
7.3.210.0060.01116.48
7.3.200.0090.00919.39
7.3.190.0120.01016.10
7.3.180.0070.00816.10
7.3.170.0150.00616.46
7.3.160.0070.00716.24
7.3.120.0000.01514.64
7.2.330.0040.01416.57
7.2.320.0170.00716.71
7.2.310.0080.00816.63
7.2.300.0080.00816.32
7.2.290.0160.00716.46
7.2.60.0030.00916.70
7.2.00.0060.00319.32
7.1.200.0070.00715.40
7.1.100.0190.01016.06
7.1.70.0030.00616.86
7.1.60.0000.01819.40
7.1.50.0100.01316.91
7.1.00.0030.03322.57
7.0.200.0030.00616.69
7.0.140.0000.08022.15
7.0.60.0370.07019.94
7.0.50.0270.08320.31
7.0.40.0230.08720.12
7.0.30.0330.06720.04
7.0.20.0270.07320.07
7.0.10.0170.04720.14
7.0.00.0200.07020.18
5.6.280.0030.07321.04
5.6.210.0330.07020.53
5.6.200.0330.07021.13
5.6.190.0270.08020.99
5.6.180.0300.07021.14
5.6.170.0300.05721.15
5.6.160.0330.04021.02
5.6.150.0270.07021.02
5.6.140.0300.06721.09
5.6.130.0230.07021.03
5.6.120.0370.07021.05
5.6.110.0300.07720.89
5.6.100.0300.07720.96
5.6.90.0200.06321.01
5.6.80.0230.06720.45
5.6.70.0230.06320.37
5.6.60.0300.05020.39
5.6.50.0300.07320.38
5.6.40.0370.06720.42
5.6.30.0300.07720.35
5.6.20.0300.06020.35
5.6.10.0230.04720.50
5.6.00.0230.07720.34
5.5.350.0170.07320.44
5.5.340.0230.08020.88
5.5.330.0330.06720.74
5.5.320.0300.05720.74
5.5.310.0270.06720.73
5.5.300.0270.07020.90
5.5.290.0270.07020.89
5.5.280.0300.08020.84
5.5.270.0330.07020.77
5.5.260.0470.05720.76
5.5.250.0270.06020.79
5.5.240.0300.05020.19
5.5.230.0270.07020.00
5.5.220.0300.07020.14
5.5.210.0200.08320.23
5.5.200.0200.05720.09
5.5.190.0170.05020.12
5.5.180.0370.06720.13
5.5.160.0230.08020.13
5.5.150.0230.07020.17
5.5.140.0300.06719.97
5.5.130.0270.07720.22
5.5.120.0270.07320.15
5.5.110.0270.08020.15
5.5.100.0170.04320.02
5.5.90.0230.07020.14
5.5.80.0230.06020.00
5.5.70.0200.05020.13
5.5.60.0230.07720.10
5.5.50.0270.07020.03
5.5.40.0300.06720.07
5.5.30.0270.05719.97
5.5.20.0300.05719.88
5.5.10.0330.07020.14
5.5.00.0200.07320.01
5.4.450.0330.06019.49
5.4.440.0330.07019.34
5.4.430.0230.08019.37
5.4.420.0330.07019.39
5.4.410.0230.06019.14
5.4.400.0230.07319.17
5.4.390.0230.08019.22
5.4.380.0170.05318.91
5.4.370.0200.07319.02
5.4.360.0170.08319.01
5.4.350.0230.07718.91
5.4.340.0270.07019.01
5.4.320.0230.07719.20
5.4.310.0270.06719.17
5.4.300.0330.05319.06
5.4.290.0230.07018.91
5.4.280.0230.07319.20
5.4.270.0230.05319.14
5.4.260.0300.06319.20
5.4.250.0230.06018.91
5.4.240.0330.05718.89
5.4.230.0230.07719.07
5.4.220.0330.05718.89
5.4.210.0200.07718.88
5.4.200.0200.06019.00
5.4.190.0270.05719.05
5.4.180.0200.08318.89
5.4.170.0200.08319.00
5.4.160.0270.06718.89
5.4.150.0270.07718.86
5.4.140.0230.08016.40
5.4.130.0230.06316.34
5.4.120.0270.06316.36
5.4.110.0230.06716.34
5.4.100.0270.03016.34
5.4.90.0270.06316.42
5.4.80.0230.03016.39
5.4.70.0230.07316.37
5.4.60.0170.05016.45
5.4.50.0200.03716.27
5.4.40.0230.06716.57
5.4.30.0270.06716.52
5.4.20.0230.07016.48
5.4.10.0230.07016.22
5.4.00.0300.06715.91
5.3.290.0200.08014.73
5.3.280.0300.06314.64
5.3.270.0270.07314.62
5.3.260.0200.07014.61
5.3.250.0200.07314.66
5.3.240.0270.06714.65
5.3.230.0330.03714.56
5.3.220.0270.06314.52
5.3.210.0370.06314.58
5.3.200.0200.03714.52
5.3.190.0330.06714.58
5.3.180.0230.04014.67
5.3.170.0200.03314.66
5.3.160.0200.04314.63
5.3.150.0230.05314.60
5.3.140.0270.03014.54
5.3.130.0230.04714.59
5.3.120.0330.04714.58
5.3.110.0230.07014.65
5.3.100.0230.06014.14
5.3.90.0270.06314.01
5.3.80.0200.07314.07
5.3.70.0200.07713.98
5.3.60.0170.06314.06
5.3.50.0230.05314.07
5.3.40.0300.05313.86
5.3.30.0170.04013.82
5.3.20.0130.04313.75
5.3.10.0170.03313.76
5.3.00.0170.03313.62
5.2.170.0200.05711.04
5.2.160.0230.06011.20
5.2.150.0170.05711.19
5.2.140.0100.03711.24
5.2.130.0100.03011.20
5.2.120.0100.03011.11
5.2.110.0100.03011.19
5.2.100.0130.02711.21
5.2.90.0170.02311.19
5.2.80.0100.03010.99
5.2.70.0100.03011.14
5.2.60.0170.02711.02
5.2.50.0100.02311.10
5.2.40.0100.02311.05
5.2.30.0070.03311.04
5.2.20.0130.02311.01
5.2.10.0100.02310.90
5.2.00.0130.02310.77
5.1.60.0030.02310.03
5.1.50.0130.03010.05
5.1.40.0100.02010.00
5.1.30.0070.02710.24
5.1.20.0130.01710.25
5.1.10.0100.02310.17
5.1.00.0100.02010.16
5.0.50.0100.0178.68
5.0.40.0070.0178.68
5.0.30.0030.0278.68
5.0.20.0000.0208.68
5.0.10.0000.0208.68
5.0.00.0070.0238.68
4.4.90.0070.0138.68
4.4.80.0030.0138.68
4.4.70.0070.0138.68
4.4.60.0030.0208.68
4.4.50.0100.0178.68
4.4.40.0070.0178.68
4.4.30.0070.0178.68
4.4.20.0000.0178.68
4.4.10.0070.0138.68
4.4.00.0070.0208.68
4.3.110.0030.0178.68
4.3.100.0070.0108.68
4.3.90.0030.0138.68
4.3.80.0070.0178.68
4.3.70.0030.0138.68
4.3.60.0030.0138.68
4.3.50.0030.0138.68
4.3.40.0030.0208.68
4.3.30.0000.0138.68
4.3.20.0000.0138.68
4.3.10.0030.0108.68
4.3.00.0000.0138.68

preferences:
66.73 ms | 400 KiB | 5 Q