3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function sum_int(int $a, int $b) : int { return $a + $b; } function sum_float(float $a, float $b) : float { return $a + $b; } function substract_int(int $a, int $b) : int { return $a - $b; } function substract_float(float $a, float $b) : float { return $a - $b; } function multiply_int(int $a, int $b) : int { return $a * $b; } function multiply_float(float $a, float $b) : float { return $a * $b; } function divide_int(int $a, int $b) : int { return $b == 0 ? $a : $a / $b; } function divide_float(float $a, float $b) : float { return $b == 0 ? $a : $a / $b; } echo "La somme de 9 + 14 = " . sum_int(9, 14) . "\r\n"; echo "La somme de 1.895 + 8.105 = " . sum_float(1.895, 8.105) . "\r\n"; echo "La soustraction de 9 - 14 = " . substract_int(9, 14) . "\r\n"; echo "La soustraction de 1.895 - 8.105 = " . substract_float(1.895, 8.105) . "\r\n"; echo "La multiplication de 9 * 14 = " . multiply_int(9, 14) . "\r\n"; echo "La multiplication de 1.895 * 8.105 = " . multiply_float(1.895, 8.105) . "\r\n"; echo "La division de 9 / 14 = " . divide_int(9, 0) . "\r\n"; echo "La division de 1.895 / 8.105 = " . divide_float(1.895, 0) . "\r\n";

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.0090.00916.50
8.3.50.0120.00916.35
8.3.40.0140.00318.84
8.3.30.0110.00418.68
8.3.20.0080.00020.34
8.3.10.0020.00523.61
8.3.00.0000.00819.64
8.2.180.0120.00816.50
8.2.170.0150.00022.96
8.2.160.0140.00020.40
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00417.50
8.2.110.0030.00622.24
8.2.100.0090.00317.63
8.2.90.0050.00319.17
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0040.00418.04
8.2.50.0030.00718.07
8.2.40.0040.00419.21
8.2.30.0050.00518.03
8.2.20.0000.00817.65
8.2.10.0030.00518.10
8.2.00.0040.00417.90
8.1.280.0040.01125.92
8.1.270.0080.00020.22
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.52
8.1.230.0120.00017.42
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0050.00317.10
8.1.180.0000.00718.10
8.1.170.0000.00818.60
8.1.160.0000.00822.04
8.1.150.0040.00418.85
8.1.140.0000.00817.42
8.1.130.0030.00317.58
8.1.120.0000.00717.31
8.1.110.0040.00417.44
8.1.100.0040.00417.40
8.1.90.0040.00417.32
8.1.80.0060.00317.43
8.1.70.0000.00817.47
8.1.60.0030.00517.57
8.1.50.0000.00817.38
8.1.40.0050.00317.39
8.1.30.0060.00317.64
8.1.20.0030.00617.68
8.1.10.0030.00617.45
8.1.00.0080.00017.35
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.38
8.0.270.0070.00017.27
8.0.260.0060.00317.15
8.0.250.0000.00717.07
8.0.240.0030.00316.95
8.0.230.0030.00317.05
8.0.220.0050.00216.94
8.0.210.0030.00516.89
8.0.200.0050.00316.87
8.0.190.0030.00517.00
8.0.180.0080.00016.91
8.0.170.0030.00616.96
8.0.160.0030.00316.88
8.0.150.0060.00316.92
8.0.140.0000.00816.96
8.0.130.0060.00013.40
8.0.120.0000.00816.86
8.0.110.0050.00217.00
8.0.100.0000.00716.87
8.0.90.0040.00417.05
8.0.80.0070.01117.00
8.0.70.0040.00417.04
8.0.60.0000.00716.96
8.0.50.0070.00016.85
8.0.30.0100.00717.20
8.0.20.0120.00817.40
8.0.10.0000.00717.07
8.0.00.0070.01216.63
7.4.330.0030.00315.08
7.4.320.0030.00316.48
7.4.300.0000.00616.53
7.4.290.0030.00316.48
7.4.280.0000.00816.41
7.4.270.0000.00716.50
7.4.260.0030.00616.45
7.4.250.0030.00616.50
7.4.240.0050.00216.52
7.4.230.0000.00716.28
7.4.220.0070.01116.54
7.4.210.0060.00916.54
7.4.200.0070.00016.36
7.4.160.0060.01016.54
7.4.150.0040.01417.40
7.4.140.0100.01117.86
7.4.130.0040.01316.47
7.4.120.0060.01416.50
7.4.110.0070.01016.24
7.4.100.0120.00916.40
7.4.90.0100.00616.58
7.4.80.0030.01519.39
7.4.70.0190.00316.54
7.4.60.0090.01016.33
7.4.50.0000.00616.43
7.4.40.0080.00816.66
7.4.30.0040.01816.64
7.4.00.0030.01215.14
7.3.330.0050.00013.29
7.3.320.0060.00013.19
7.3.310.0040.00416.36
7.3.300.0040.00416.38
7.3.290.0110.00716.34
7.3.280.0090.00816.34
7.3.270.0180.00617.40
7.3.260.0130.00316.71
7.3.250.0140.00716.53
7.3.240.0130.01016.46
7.3.230.0100.00716.60
7.3.210.0030.01316.51
7.3.200.0110.00616.42
7.3.190.0140.00716.28
7.3.180.0120.00316.27
7.3.170.0100.00516.47
7.3.160.0110.00616.35
7.3.120.0070.01114.78
7.3.110.0070.01115.18
7.3.100.0070.00714.72
7.3.90.0080.00815.16
7.3.80.0100.00315.00
7.3.70.0070.00814.93
7.3.60.0110.00414.91
7.3.50.0000.01414.81
7.3.40.0090.00314.96
7.3.30.0000.00915.00
7.3.20.0100.00716.47
7.3.10.0100.00716.68
7.3.00.0040.00916.60
7.2.330.0060.01216.49
7.2.320.0110.00816.46
7.2.310.0070.01016.55
7.2.300.0060.01116.72
7.2.290.0090.01316.79
7.2.250.0100.01014.74
7.2.240.0100.01014.95
7.2.230.0100.00715.00
7.2.220.0050.00514.98
7.2.210.0100.00315.03
7.2.200.0060.01014.87
7.2.190.0060.00915.01
7.2.180.0030.01015.04
7.2.170.0080.00314.86
7.2.60.0090.00616.27
7.2.00.0100.00319.45
7.1.330.0030.01115.86
7.1.320.0090.00615.98
7.1.310.0060.00315.73
7.1.300.0100.00315.71
7.1.290.0090.00315.68
7.1.280.0060.01215.84
7.1.270.0040.01115.63
7.1.260.0100.00015.91
7.1.200.0130.00415.46
7.1.100.0080.00818.12
7.1.70.0030.00516.75
7.1.60.0030.01819.27
7.1.50.0060.01916.63
7.1.00.0030.07722.46
7.0.200.0170.00616.66
7.0.120.0030.04322.07
7.0.110.0200.07322.08
7.0.100.0070.07721.97
7.0.90.0030.07321.95
7.0.80.0030.05722.04
7.0.70.0030.04022.11
7.0.60.0030.05722.01
7.0.50.0030.06322.12
7.0.40.0130.03019.95
7.0.30.0030.07720.00
7.0.20.0030.04320.04
7.0.10.0070.06020.09
7.0.00.0170.06020.00
5.6.280.0000.04321.14
5.6.270.0030.08320.98
5.6.260.0000.08320.84
5.6.250.0030.07320.80
5.6.240.0000.07721.01
5.6.230.0130.07020.96
5.6.220.0070.05020.82
5.6.210.0030.04320.96
5.6.200.0030.07720.77
5.6.190.0100.07720.96
5.6.180.0030.04320.92
5.6.170.0000.07720.94
5.6.160.0000.08720.93
5.6.150.0100.07020.96
5.6.140.0000.08020.77
5.6.130.0070.03320.86
5.6.120.0030.04320.87
5.6.110.0000.07320.79
5.6.100.0130.06720.93
5.6.90.0030.07020.92
5.6.80.0030.06720.39
5.6.70.0030.03720.21
5.6.60.0070.07320.35
5.6.50.0030.05020.23
5.6.40.0000.08020.13
5.6.30.0100.05720.32
5.6.20.0070.08020.34
5.6.10.0130.07320.34
5.6.00.0170.05320.41
5.5.380.0070.04017.57
5.5.370.0070.04717.52
5.5.360.0070.03717.70
5.5.350.0000.04317.47
5.5.340.0070.06718.06
5.5.330.0070.08018.09
5.5.320.0030.08017.90
5.5.310.0070.08318.21
5.5.300.0130.07017.85
5.5.290.0030.08018.18
5.5.280.0000.05718.05
5.5.270.0000.04318.05
5.5.260.0170.04017.92
5.5.250.0070.04018.02
5.5.240.0030.08717.48
5.5.230.0030.07317.43
5.5.220.0030.07317.34
5.5.210.0100.07317.34
5.5.200.0030.04017.44
5.5.190.0070.03717.46
5.5.180.0100.07317.31
5.5.160.0030.07317.18
5.5.150.0030.04017.44
5.5.140.0030.03717.48
5.5.130.0030.03717.18
5.5.120.0000.06317.18
5.5.110.0100.04317.44
5.5.100.0100.03017.11
5.5.90.0100.06317.35
5.5.80.0100.06717.50
5.5.70.0030.06717.15
5.5.60.0100.07017.38
5.5.50.0030.04317.33
5.5.40.0000.04317.07
5.5.30.0030.03717.17
5.5.20.0030.06017.16
5.5.10.0030.07017.16
5.5.00.0100.07317.31
5.4.450.0030.08719.46
5.4.440.0030.04019.49
5.4.430.0000.07319.52
5.4.420.0070.07719.36
5.4.410.0100.06019.33
5.4.400.0070.06019.25
5.4.390.0000.08019.09
5.4.380.0170.05718.98
5.4.370.0030.04019.09
5.4.360.0000.08018.93
5.4.350.0130.06018.91
5.4.340.0000.04319.20
5.4.320.0030.07319.13
5.4.310.0030.04719.18
5.4.300.0000.07018.96
5.4.290.0100.07719.19
5.4.280.0030.06318.94
5.4.270.0030.04018.94
5.4.260.0030.07318.96
5.4.250.0100.07019.03
5.4.240.0030.06019.12
5.4.230.0030.03719.17
5.4.220.0100.07018.89
5.4.210.0130.03319.18
5.4.200.0070.05718.95
5.4.190.0070.05318.89
5.4.180.0030.04019.27
5.4.170.0030.07718.95
5.4.160.0000.06718.95
5.4.150.0030.05718.92
5.4.140.0030.04316.31
5.4.130.0030.07016.35
5.4.120.0100.06316.51
5.4.110.0030.04016.41
5.4.100.0100.04316.59
5.4.90.0030.06316.56
5.4.80.0100.06716.55
5.4.70.0070.06316.41
5.4.60.0000.06316.43
5.4.50.0070.03016.23
5.4.40.0030.04716.54
5.4.30.0100.04716.35
5.4.20.0000.03716.23
5.4.10.0030.07016.42
5.4.00.0000.03715.86

preferences:
50.68 ms | 400 KiB | 5 Q