3v4l.org

run code in 300+ PHP versions simultaneously
<?php function nums() { $ary = [24,25,26,27,28,29,30,31,32]; $i = 0; foreach ($ary as $x) { $cmd = (yield $x); // yield expr if ($cmd == 'stop') { return "Generator is now Stopped","\n"; } } echo "Generator is now closed","\n"; return; } $gen = nums(); foreach ($gen as $value) { echo "$value\n"; if ($value == 26) { // don't let it get to 32 $gen->send('stop'); } }

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.220.0090.04612.40
5.4.210.0100.04512.40
5.4.200.0110.04712.40
5.4.190.0110.04412.39
5.4.180.0130.04412.39
5.4.170.0110.04712.40
5.4.160.0110.04812.39
5.4.150.0120.04112.39
5.4.140.0120.06012.08
5.4.130.0120.04012.06
5.4.120.0120.04412.03
5.4.110.0100.05012.03
5.4.100.0110.04312.02
5.4.90.0090.04712.02
5.4.80.0130.04412.02
5.4.70.0100.04612.02
5.4.60.0120.05312.02
5.4.50.0130.04912.02
5.4.40.0150.05812.01
5.4.30.0100.04412.00
5.4.20.0120.04212.00
5.4.10.0110.04212.00
5.4.00.0070.04211.50
5.3.270.0140.04812.73
5.3.260.0120.05412.72
5.3.250.0150.04812.72
5.3.240.0130.04912.72
5.3.230.0110.05212.71
5.3.220.0100.04612.68
5.3.210.0200.07112.68
5.3.200.0110.04712.68
5.3.190.0110.04712.68
5.3.180.0110.04412.67
5.3.170.0210.06012.67
5.3.160.0110.04612.67
5.3.150.0150.05412.67
5.3.140.0110.04812.66
5.3.130.0130.04812.66
5.3.120.0150.06212.66
5.3.110.0130.04812.66
5.3.100.0130.04412.13
5.3.90.0130.04412.10
5.3.80.0110.04612.09
5.3.70.0160.06212.09
5.3.60.0110.04512.08
5.3.50.0140.04512.01
5.3.40.0120.04512.02
5.3.30.0170.05311.97
5.3.20.0130.04411.76
5.3.10.0090.04811.72
5.3.00.0130.05511.71

preferences:
135.56 ms | 1398 KiB | 7 Q