3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function yieldAll(array $total) { if (!version_compare(phpversion(), '5.5.0', '>=') && !defined('HHVM_VERSION')) { throw new DomainException(__FUNCTION__.' works only with a PHP version that supports Generators'); } foreach ($total as $key => $value) { $stmt = (yield $key => $value); if (! $stmt) { return; } } } $toto = []; $res = yieldAll(['toto', 'tata', 'tutu']); foreach ($res as $key => $value) { if (1 == $key) { $res->send(false); } $toto[$key] = $value; } var_dump($toto);

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)
5.4.260.0060.03812.38
5.4.250.0050.04012.38
5.4.240.0070.03512.38
5.4.230.0040.04312.37
5.4.220.0060.03912.37
5.4.210.0030.03812.37
5.4.200.0040.03812.37
5.4.190.0070.03412.36
5.4.180.0060.03512.36
5.4.170.0070.03412.37
5.4.160.0030.03812.36
5.4.150.0070.04812.36
5.4.140.0050.03812.05
5.4.130.0090.04012.03
5.4.120.0040.03712.00
5.4.110.0070.03312.00
5.4.100.0060.03411.99
5.4.90.0040.04112.00
5.4.80.0050.04012.00
5.4.70.0040.03711.99
5.4.60.0050.04111.99
5.4.50.0060.03711.99
5.4.40.0070.03411.98
5.4.30.0070.03611.98
5.4.20.0050.03611.97
5.4.10.0050.03511.98
5.4.00.0020.03911.47
5.3.280.0050.03912.71
5.3.270.0090.03612.72
5.3.260.0060.04212.71
5.3.250.0030.04012.72
5.3.240.0030.04512.72
5.3.230.0080.04812.71
5.3.220.0070.03612.68
5.3.210.0040.04112.68
5.3.200.0070.04612.68
5.3.190.0070.03812.68
5.3.180.0080.03712.68
5.3.170.0060.03712.66
5.3.160.0100.03312.67
5.3.150.0070.04112.67
5.3.140.0060.03712.66
5.3.130.0080.03712.66
5.3.120.0050.04512.66
5.3.110.0070.04712.66
5.3.100.0070.04212.12
5.3.90.0030.04012.08
5.3.80.0060.03612.07
5.3.70.0090.04312.07
5.3.60.0050.04512.07
5.3.50.0070.03912.00
5.3.40.0060.03912.00
5.3.30.0080.03711.95
5.3.20.0040.04111.73
5.3.10.0060.03411.69
5.3.00.0030.03811.68

preferences:
144.76 ms | 1394 KiB | 7 Q