3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
?php $value1 = $_POST['value1']; $value2 = $_POST['value2']; ?> <html> <title>PHP - Add two numbers</title> <body> <form action="addtwonumbers.php" method="post"> <input type="text" name="value1" value="0" /> <input type="text" name="value2" value="0" /> <input type="submit" value="Calculate values"/> </form> Answer : <?php echo ($value1 + $value2); ?> </body> </html> echo "Please enter value 1 : "; fscanf(STDIN, "%d\n", $value1); // reads number from STDIN standard input echo "Please enter value 2 : "; fscanf(STDIN, "%d\n", $value2); echo "Answer : " .($value1 + $value2) . "\n";
based on r0AfA

Here you find the average performance (time & memory) of each version. A greyed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.0beta10.0030.00312.29
7.3.0alpha10.0030.00812.41
7.2.60.0130.00016.89
7.2.50.0150.00016.63
7.2.00.0250.00019.18
7.1.200.0070.00715.68
7.1.70.0040.00417.21
7.1.60.0070.01819.61
7.1.50.0040.01916.53
7.1.00.0030.07722.40
7.0.200.0000.01016.67
7.0.140.0030.06722.08
7.0.60.0100.05719.92
7.0.50.0030.05017.90
7.0.40.0000.05320.06
7.0.30.0170.04720.17
7.0.20.0370.04720.33
7.0.10.0100.04320.19
7.0.00.0100.06020.16
5.6.210.0070.08720.71
5.6.200.0070.08318.18
5.6.190.0230.07320.67
5.6.180.0200.07720.57
5.6.170.0330.04720.37
5.6.160.0130.05720.72
5.6.150.0030.06018.15
5.6.140.0170.04018.18
5.6.130.0200.07018.07
5.6.120.0070.08321.09
5.6.110.0130.07721.08
5.6.100.0070.08020.88
5.6.90.0030.08720.96
5.6.80.0070.07720.38
5.5.350.0270.08020.32
5.5.340.0200.06718.02
5.5.330.0030.04720.21
5.5.320.0230.05320.51
5.5.310.0200.03720.50
5.5.300.0070.03317.91
5.5.290.0070.08017.96
5.5.280.0170.05720.86
5.5.270.0070.06020.86
5.5.260.0030.05320.79
5.5.250.0200.06320.68
5.5.240.0070.02720.27
5.4.450.0430.03319.38
5.4.440.0100.04319.26
5.4.430.0200.04019.41
5.4.420.0170.03019.54
5.4.410.0500.03719.02
5.4.400.0100.04719.25
5.4.390.0400.04719.09
5.4.380.0300.06018.76
5.4.370.0430.06718.48
5.4.360.0270.06018.73
5.4.350.0330.08318.61
5.4.340.0230.05318.73
5.4.320.0060.03612.46
5.4.310.0080.03812.45
5.4.300.0100.03612.45
5.4.290.0050.04212.45
5.4.280.0050.04012.34
5.4.270.0090.03812.35
5.4.260.0100.04012.34
5.4.250.0100.04912.34
5.4.240.0050.04312.34
5.4.230.0070.04612.34
5.4.220.0100.04112.34
5.4.210.0090.04012.34
5.4.200.0080.04212.34
5.4.190.0100.05612.34
5.4.180.0050.04312.34
5.4.170.0080.03612.35
5.4.160.0100.03512.34
5.4.150.0070.04212.34
5.4.140.0120.04612.02
5.4.130.0120.04312.01
5.4.120.0120.04311.97
5.4.110.0040.05111.96
5.4.100.0100.03711.96
5.4.90.0070.03611.96
5.4.80.0070.03611.96
5.4.70.0020.04011.96
5.4.60.0060.03511.96
5.4.50.0040.03811.96
5.4.40.0060.03511.95
5.4.30.0070.03511.95
5.4.20.0050.03711.94
5.4.10.0020.03911.95
5.4.00.0050.03811.43
5.3.290.0060.04012.80
5.3.280.0040.04112.70
5.3.270.0100.03712.73
5.3.260.0050.04312.72
5.3.250.0050.04212.72
5.3.240.0070.04012.72
5.3.230.0070.04012.71
5.3.220.0070.03812.68
5.3.210.0080.04012.68
5.3.200.0120.03312.68
5.3.190.0030.04512.68
5.3.180.0100.03712.68
5.3.170.0080.03612.67
5.3.160.0100.03812.68
5.3.150.0100.03712.67
5.3.140.0030.04412.66
5.3.130.0100.03912.65
5.3.120.0070.04112.66
5.3.110.0080.05112.66
5.3.100.0060.03812.12
5.3.90.0060.03712.09
5.3.80.0080.03612.07
5.3.70.0040.04812.08
5.3.60.0080.03712.06
5.3.50.0050.03812.00
5.3.40.0050.04012.00
5.3.30.0060.03811.94
5.3.20.0090.04611.72
5.3.10.0030.03911.69
5.3.00.0060.03711.68
5.2.170.0070.0299.18
5.2.160.0080.0299.18
5.2.150.0080.0359.17
5.2.140.0020.0349.17
5.2.130.0050.0289.14
5.2.120.0070.0269.14
5.2.110.0060.0289.14
5.2.100.0010.0329.13
5.2.90.0120.0239.14
5.2.80.0080.0309.13
5.2.70.0060.0319.13
5.2.60.0090.0289.09
5.2.50.0070.0299.06
5.2.40.0060.0299.03
5.2.30.0040.0309.00
5.2.20.0070.0299.00
5.2.10.0050.0298.93
5.2.00.0090.0338.79
5.1.60.0070.0288.07
5.1.50.0070.0278.07
5.1.40.0080.0228.05
5.1.30.0050.0338.40
5.1.20.0060.0298.42
5.1.10.0050.0258.15
5.1.00.0050.0268.15
5.0.50.0070.0196.63
5.0.40.0050.0216.49
5.0.30.0080.0326.30
5.0.20.0040.0236.27
5.0.10.0040.0226.25
5.0.00.0050.0356.24
4.4.90.0020.0174.78
4.4.80.0070.0124.75
4.4.70.0040.0214.75
4.4.60.0040.0164.75
4.4.50.0000.0194.77
4.4.40.0040.0264.71
4.4.30.0020.0234.76
4.4.20.0030.0164.85
4.4.10.0050.0154.85
4.4.00.0020.0274.76
4.3.110.0050.0164.66
4.3.100.0030.0154.66
4.3.90.0040.0154.63
4.3.80.0070.0264.59
4.3.70.0030.0184.63
4.3.60.0040.0194.63
4.3.50.0010.0184.63
4.3.40.0020.0344.54
4.3.30.0040.0203.29
4.3.20.0050.0193.27
4.3.10.0050.0193.23
4.3.00.0000.02018.16