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_int(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_int(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_int(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_int(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.0070.01116.73
8.3.50.0090.00916.46
8.3.40.0100.00718.79
8.3.30.0150.00018.79
8.3.20.0060.00320.13
8.3.10.0080.00023.61
8.3.00.0080.00019.79
8.2.180.0120.00916.75
8.2.170.0030.01022.96
8.2.160.0060.01020.38
8.2.150.0000.00824.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00417.75
8.2.110.0060.00322.08
8.2.100.0060.00617.63
8.2.90.0030.00619.09
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0040.00418.03
8.2.50.0090.00418.07
8.2.40.0000.00719.34
8.2.30.0090.00018.09
8.2.20.0000.00817.82
8.2.10.0080.00017.96
8.2.00.0070.00018.09
8.1.280.0100.00325.92
8.1.270.0040.00420.43
8.1.260.0000.00826.35
8.1.250.0050.00228.09
8.1.240.0030.00622.47
8.1.230.0040.00817.42
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0070.00317.35
8.1.190.0000.00817.10
8.1.180.0000.00718.10
8.1.170.0030.00618.25
8.1.160.0050.00322.07
8.1.150.0080.00018.85
8.1.140.0030.00617.42
8.1.130.0030.00317.67
8.1.120.0000.00717.32
8.1.110.0070.00017.45
8.1.100.0000.00917.36
8.1.90.0040.00417.28
8.1.80.0040.00417.29
8.1.70.0040.00417.46
8.1.60.0070.00017.55
8.1.50.0050.00317.49
8.1.40.0060.00317.47
8.1.30.0030.00517.52
8.1.20.0080.00017.59
8.1.10.0000.00817.54
8.1.00.0070.00017.44
8.0.300.0030.00618.77
8.0.290.0040.00416.75
8.0.280.0030.00318.43
8.0.270.0030.00317.29
8.0.260.0060.00317.34
8.0.250.0040.00417.08
8.0.240.0000.00717.02
8.0.230.0050.00217.03
8.0.220.0030.00316.91
8.0.210.0080.00016.94
8.0.200.0030.00316.93
8.0.190.0080.00016.98
8.0.180.0040.00417.02
8.0.170.0070.00016.94
8.0.160.0040.00416.95
8.0.150.0000.00716.93
8.0.140.0050.00216.83
8.0.130.0060.00013.37
8.0.120.0060.00316.88
8.0.110.0070.00016.94
8.0.100.0050.00316.92
8.0.90.0030.00616.98
8.0.80.0000.01516.89
8.0.70.0040.00416.84
8.0.60.0070.00016.89
8.0.50.0040.00416.74
8.0.30.0050.01417.21
8.0.20.0130.00817.40
8.0.10.0000.00817.07
8.0.00.0090.00916.76
7.4.330.0030.00315.08
7.4.320.0000.00716.41
7.4.300.0070.00016.39
7.4.290.0030.00316.55
7.4.280.0000.00816.57
7.4.270.0000.00716.52
7.4.260.0030.00716.43
7.4.250.0050.00316.41
7.4.240.0000.00716.52
7.4.230.0000.00716.52
7.4.220.0060.01216.58
7.4.210.0060.00916.57
7.4.200.0070.00016.64
7.4.160.0040.01216.50
7.4.150.0000.02017.40
7.4.140.0130.00817.86
7.4.130.0110.00616.46
7.4.120.0120.00716.46
7.4.110.0030.01316.54
7.4.100.0110.01116.52
7.4.90.0110.00616.51
7.4.80.0200.00019.39
7.4.70.0160.00616.68
7.4.60.0130.00316.46
7.4.50.0040.00416.44
7.4.40.0100.00716.71
7.4.30.0070.01516.58
7.4.00.0030.00614.86
7.3.330.0000.00613.32
7.3.320.0030.00313.42
7.3.310.0050.00216.37
7.3.300.0000.00716.36
7.3.290.0100.00916.42
7.3.280.0090.00816.34
7.3.270.0140.00317.40
7.3.260.0030.01416.71
7.3.250.0070.01016.59
7.3.240.0060.01116.64
7.3.230.0030.01316.65
7.3.210.0070.01016.41
7.3.200.0130.00316.62
7.3.190.0170.00016.70
7.3.180.0070.01016.42
7.3.170.0060.00916.38
7.3.160.0040.01216.43
7.2.330.0190.00016.80
7.2.320.0100.01316.72
7.2.310.0100.00616.38
7.2.300.0070.01016.88
7.2.290.0090.00616.61
7.2.80.0180.01116.38
7.2.60.0090.00916.48
7.2.00.0070.01519.16
7.1.200.0000.01315.89
7.1.100.0080.00418.13
7.1.70.0020.00517.06
7.1.60.0030.01719.27
7.1.50.0160.00716.83
7.1.00.0030.07722.43
7.0.200.0540.00414.66
7.0.60.0070.08319.85
7.0.50.0030.08717.75
7.0.40.0030.08320.11
7.0.30.0200.04020.26
7.0.20.0330.07720.26
7.0.10.0100.08020.05
7.0.00.0070.07320.22
5.6.280.0030.05320.79
5.6.210.0030.04720.52
5.6.200.0100.06318.21
5.6.190.0100.08720.59
5.6.180.0270.08020.55
5.6.170.0230.06320.55
5.6.160.0100.04020.61
5.6.150.0130.07718.16
5.6.140.0030.08318.15
5.6.130.0030.08318.16
5.6.120.0070.03721.00
5.6.110.0100.03721.12
5.6.100.0070.06320.98
5.6.90.0030.08720.95
5.6.80.0100.06320.36
5.6.70.4500.03720.28
5.5.350.0030.05020.32
5.5.340.0070.07017.95
5.5.330.0100.08020.41
5.5.320.0270.07020.41
5.5.310.0200.05720.30
5.5.300.0100.08317.95
5.5.290.0100.07317.97
5.5.280.0030.07720.87
5.5.270.0030.04720.77
5.5.260.0100.07720.80
5.5.250.0070.06720.59
5.5.240.0100.07320.26
5.4.450.0630.05719.40
5.4.440.0670.05319.20
5.4.430.0370.05319.51
5.4.420.0270.03719.20
5.4.410.0030.06319.45
5.4.400.0530.05318.77
5.4.390.0470.04718.78
5.4.380.0070.05719.07
5.4.370.0300.05318.96
5.4.360.0670.07319.21
5.4.350.0570.05319.26
5.4.340.0700.05718.96
5.4.320.0730.06019.21
5.4.310.0600.05718.96
5.4.300.0530.07019.07
5.4.290.0570.06019.01
5.4.280.0700.07319.19
5.4.270.0630.05719.09
5.4.260.0700.05018.77
5.4.250.0870.07019.18
5.4.240.0870.04719.22
5.4.230.0830.04718.79
5.4.220.0570.06018.95
5.4.210.0770.05719.21
5.4.200.0730.05319.20
5.4.190.0700.06019.34
5.4.180.0800.05718.77
5.4.170.0600.05719.20
5.4.160.0730.04719.29
5.4.150.0570.05719.17
5.4.140.0600.05316.35
5.4.130.0600.05016.59
5.4.120.0800.06016.53
5.4.110.0700.07716.61
5.4.100.0570.06016.65
5.4.90.0430.05016.65
5.4.80.0700.05016.67
5.4.70.0300.06016.28
5.4.60.0330.06716.23
5.4.50.0000.03716.51
5.4.40.0070.05316.43
5.4.30.0070.04016.52
5.4.20.0230.03016.52

preferences:
44.23 ms | 400 KiB | 5 Q