3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { yield 0; yield ['a','b','c'][1]; yield 2; yield 3; yield $element = array('tom','dick','sally','sue')[2]; } try { $o = gen(); foreach($o as $g) { echo $g,' '; echo empty(boolval($g))? 'false' : 'true'; echo "\n"; } } catch (Exception $e) { echo "caught exception"; } finally { echo "Whatever, this line will always run"; } $names = array(array("Rasmus","Lerdorf"), array("Andi","Gutmans"),array("Zeev","Suraski")); foreach ($names as list($fname,$lname) { echo $fname, "\n"; }

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.110.0130.03912.00
5.4.100.0130.04112.01
5.4.90.0120.04112.01
5.4.80.0130.03912.01
5.4.70.0130.03812.00
5.4.60.0110.04012.01
5.4.50.0140.03812.00
5.4.40.0110.03911.99
5.4.30.0140.05711.99
5.4.20.0130.03811.98
5.4.10.0180.05611.99
5.4.00.0120.03911.48
5.3.210.0130.05212.68
5.3.200.0130.04112.68
5.3.190.0110.04412.68
5.3.180.0120.04312.67
5.3.170.0200.05612.67
5.3.160.0120.04512.67
5.3.150.0120.04412.67
5.3.140.0160.05912.66
5.3.130.0150.04412.66
5.3.120.0130.04412.66
5.3.110.0160.05412.66
5.3.100.0150.04212.12
5.3.90.0130.04112.09
5.3.80.0150.04112.08
5.3.70.0180.05812.08
5.3.60.0140.04912.07
5.3.50.0150.04012.01
5.3.40.0130.04212.01
5.3.30.0120.04011.97
5.3.20.0140.05811.76
5.3.10.0110.04011.72
5.3.00.0090.04211.70

preferences:
139.22 ms | 1399 KiB | 7 Q