3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected function a () { $i =0 ; while (true) { $i++; if ($i > 10000) { break; } foreach ([['a' => 1],2, ['a' => 2]] as $p) { if ($p == 2) { continue; } yield $p['a'] => 123; } } }} public function b(){ $sum = 0; foreach ( a() as $k => $v ) { $sum += $k + $v; } echo 'Done: ', $sum; }} (new A)->b();

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)
7.0.20.0070.05020.21
7.0.10.0070.05320.38
7.0.00.0070.08020.21
5.6.170.0100.04320.51
5.6.160.0130.07720.58
5.6.150.0030.04018.25
5.6.140.0070.08318.11
5.6.130.0000.05018.15
5.6.120.0000.09021.12
5.6.110.0070.04021.03
5.6.100.0030.06320.85
5.6.90.0130.04020.99
5.6.80.0070.08720.38
5.5.310.0200.05320.19
5.5.300.0070.05717.97
5.5.290.0070.05717.99
5.5.280.0070.03720.80
5.5.270.0170.07320.87
5.5.260.0130.08320.89
5.5.250.0070.08320.62
5.5.240.0270.06720.16

preferences:
144.29 ms | 1394 KiB | 7 Q