3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $aufgabe = <<<AUFGABE Der Riesenhamster Hannibal hat einen Riesenvorrat an ganzen Riesenweizenkörnern für den Winter angelegt. Hannibals Winterpause dauert t ≥ 2 Tage und sein Weizenvorrat besteht aus k Körnern. Am ersten Tag der Winterpause frisst Hannibal morgens ein Weizenkorn und nachmittags 1/101 seines restlichen Vorrats. Am zweiten Tag der Winterpause frisst Hannibal morgens zwei Weizenkörner und nachmittags 1/101 seines restlichen Vorrats. Am dritten Tag der Winterpause frisst Hannibal morgens drei Weizenkörner und nachmittags 1/101 seines restlichen Vorrats. Und so weiter: Am n-ten Tag der Winterpause frisst Hannibal morgens jeweils n Weizenkörner und nachmittags 1/101 seines restlichen Vorrats. Am Morgen des t-ten und letzten Tages sind schliesslich noch genau t Körner übrig, die Hannibal ebenfalls auffrisst. Frage: Wie lautet die Einerziffer der Dezimaldarstellung von k + t? AUFGABE; for ($t = 1; $t < 100; $t++) { for ($k = 1; $k < 1000; $k++) { $vorrat = $k; for ($day = 1; $day < $t; $day++) { if ($vorrat == $day) { var_dump($t, $k); break; } $vorrat = $vorrat - $day; $vorrat = $vorrat - (1/101) * $vorrat; } } }

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).
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.2.60.0070.13317.02
7.1.200.0030.13515.76
7.1.70.0000.16017.14
7.1.60.0030.15817.37
7.1.50.0070.15816.92
7.1.00.0070.15022.38
7.0.200.0170.13516.76
7.0.140.0000.30322.15
7.0.60.0130.22320.07
7.0.50.0100.17717.81
7.0.40.0030.17020.21
7.0.30.0270.19320.00
7.0.20.0330.19720.09
7.0.10.0100.21320.09
7.0.00.0100.22320.10
5.6.280.0030.60021.04
5.6.210.0130.38320.50
5.6.200.0030.45018.23
5.6.190.0000.46020.57
5.6.180.0530.44720.35
5.6.170.0300.39020.45
5.6.160.0170.44020.46
5.6.150.0030.37718.18
5.6.140.0070.39718.16
5.6.130.0100.44718.07
5.6.120.0170.42020.99
5.6.110.0100.44021.13
5.6.100.0200.42021.13
5.6.90.0070.43021.17
5.6.80.0070.36020.38
5.5.350.0070.41020.43
5.5.340.0100.43018.01
5.5.330.0100.43720.19
5.5.320.0000.43020.27
5.5.310.0300.40020.30
5.5.300.0070.37717.92
5.5.290.0130.42017.96
5.5.280.0100.36020.77
5.5.270.0000.44720.82
5.5.260.0100.37720.95
5.5.250.0030.44320.59
5.5.240.0300.42320.05
5.4.450.0030.36319.41
5.4.440.0170.42319.13
5.4.430.0070.42319.40
5.4.420.0100.43319.23
5.4.410.0000.44719.27
5.4.400.0030.44718.79
5.4.390.0170.43019.15
5.4.380.0100.36719.11
5.4.370.0030.41318.92
5.4.360.0030.38719.10
5.4.350.0030.39718.79
5.4.340.0130.42019.09
5.4.320.0070.44719.08
5.4.310.0100.43719.08
5.4.300.0200.42719.17
5.4.290.0030.43019.14
5.4.280.0100.42019.14
5.4.270.0170.45019.11
5.4.260.0100.43319.11
5.4.250.0030.42719.17
5.4.240.0030.39719.21
5.4.230.0100.41719.14
5.4.220.0070.44019.00
5.4.210.0070.39018.80
5.4.200.0070.37019.11
5.4.190.0070.43319.13
5.4.180.0100.44718.78
5.4.170.0030.40319.14
5.4.160.0000.37019.00
5.4.150.0000.36319.07
5.4.140.0000.42316.31
5.4.130.0400.35016.25
5.4.120.0000.38316.21
5.4.110.0000.36016.23
5.4.100.0070.39016.40
5.4.90.0100.41316.30
5.4.80.0000.43716.60
5.4.70.0730.42316.22
5.4.60.0070.43016.34
5.4.50.0100.42016.12
5.4.40.0030.46716.32
5.4.30.0070.41016.43
5.4.20.0070.43716.24
5.4.10.0200.44016.57
5.4.00.0030.41715.80
5.3.290.0100.57714.50
5.3.280.0070.51314.53
5.3.270.0070.50314.57
5.3.260.0070.47714.48
5.3.250.0000.49314.55
5.3.240.0000.48014.50
5.3.230.0000.52014.53
5.3.220.0000.49314.46
5.3.210.0030.51314.36
5.3.200.0070.48714.46
5.3.190.0030.56014.46
5.3.180.0030.58014.35
5.3.170.0000.56714.50
5.3.160.0000.57014.38
5.3.150.0030.53714.52
5.3.140.0100.55714.45
5.3.130.0070.51714.37
5.3.120.0070.58014.47
5.3.110.0000.57314.51
5.3.100.0000.55013.82
5.3.90.0070.59013.98
5.3.80.0070.57013.86
5.3.70.0070.58013.80
5.3.60.0000.51313.93
5.3.50.0070.54713.88
5.3.40.0130.57013.91
5.3.30.0070.52713.92
5.3.20.0100.54713.67
5.3.10.0070.52013.74
5.3.00.0130.54313.57
5.2.170.0000.74711.11
5.2.160.0030.76311.14
5.2.150.0070.77311.15
5.2.140.0000.75711.13
5.2.130.0030.76310.94
5.2.120.0030.73711.08
5.2.110.0100.74711.08
5.2.100.0030.77711.06
5.2.90.0000.70311.08
5.2.80.0030.79011.06
5.2.70.0070.80011.06
5.2.60.0000.74311.03
5.2.50.0000.79011.00
5.2.40.0100.77711.00
5.2.30.0070.75010.86
5.2.20.0100.74310.93
5.2.10.0030.72310.89
5.2.00.0000.78310.71
5.1.60.0000.76010.05
5.1.50.0030.80710.01
5.1.40.0030.77010.04
5.1.30.1330.67710.29
5.1.20.0100.77010.46
5.1.10.0030.69710.15
5.1.00.1170.73710.14
5.0.50.0002.3738.73
5.0.40.0032.2808.54
5.0.30.0072.1378.20
5.0.20.0032.1608.41
5.0.10.0072.2208.24
5.0.00.0072.1738.37
4.4.90.0002.0908.20
4.4.80.0032.0808.20
4.4.70.0032.2808.20
4.4.60.0032.1178.20
4.4.50.0002.0908.20
4.4.40.0032.1108.20
4.4.30.0002.1178.20
4.4.20.0002.1478.20
4.4.10.0002.0578.20
4.4.00.0002.3878.20
4.3.110.0002.3038.20
4.3.100.0002.1078.20
4.3.90.0072.0878.20
4.3.80.0002.1638.20
4.3.70.0032.4608.20
4.3.60.2832.1038.20
4.3.50.0072.1738.20
4.3.40.0032.4338.20
4.3.30.0002.3478.20
4.3.20.0002.1108.20
4.3.10.0002.0578.20
4.3.00.0032.1338.20