3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { var $s; protected function a () { $i =0 ; while (true) { $i++; if ($i > 10000) { break; } foreach ([['a' => 1],2, ['a' => 2]] as $p) { if ($p == 2) { continue; } if ($i %100 == 0) { $s .= str_repeat('0123456789', 1000000); } 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.0130.04320.30
7.0.10.0030.09020.05
7.0.00.0030.04320.15
5.6.170.0270.05020.55
5.6.160.0130.06020.52
5.6.150.0030.08318.18
5.6.140.0070.06018.14
5.6.130.0070.04718.18
5.6.120.0070.08721.00
5.6.110.0130.07320.97
5.6.100.0030.06720.98
5.6.90.0030.08321.08
5.6.80.0030.06320.50
5.5.310.0230.06020.17
5.5.300.0000.04317.98
5.5.290.0030.08018.04
5.5.280.0070.08720.80
5.5.270.0030.05020.76
5.5.260.0030.04020.89
5.5.250.0070.08720.50
5.5.240.0200.07320.26

preferences:
139.51 ms | 1394 KiB | 7 Q