3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { echo 'In generator func foo',"\n"; for ($i = 11; $i < 14; $i++) { $string=(yield $i); if (isset($string)) { echo "String is $string,"\n"; } } echo 'generator done and closed.',"\n"; return; } $generator = foo(); foreach ($generator as $value) { echo "Value is $value\n"; if ($value == 13) { $generator->send('Hello World'); } }

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.0100.04512.40
5.4.210.0130.05412.39
5.4.200.0130.04712.40
5.4.190.0120.04612.39
5.4.180.0130.04612.39
5.4.170.0100.04812.40
5.4.160.0150.05512.39
5.4.150.0110.04612.39
5.4.140.0150.04612.08
5.4.130.0150.04512.06
5.4.120.0140.04812.03
5.4.110.0130.05112.03
5.4.100.0120.04312.03
5.4.90.0090.04712.02
5.4.80.0110.04812.03
5.4.70.0100.04712.02
5.4.60.0110.04512.02
5.4.50.0130.04512.02
5.4.40.0140.05112.01
5.4.30.0090.04512.00
5.4.20.0120.05012.00
5.4.10.0140.04512.00
5.4.00.0130.05111.50
5.3.270.0120.04812.73
5.3.260.0150.05812.72
5.3.250.0130.05112.72
5.3.240.0150.05712.72
5.3.230.0100.05512.71
5.3.220.0170.07512.68
5.3.210.0110.05212.68
5.3.200.0110.05112.68
5.3.190.0130.04912.68
5.3.180.0110.05312.67
5.3.170.0130.05012.67
5.3.160.0130.05112.68
5.3.150.0130.04712.67
5.3.140.0120.04912.66
5.3.130.0150.05512.66
5.3.120.0140.04712.66
5.3.110.0110.04712.66
5.3.100.0130.04812.13
5.3.90.0140.05512.10
5.3.80.0110.04612.09
5.3.70.0130.05012.09
5.3.60.0190.06112.08
5.3.50.0120.04812.01
5.3.40.0200.06812.01
5.3.30.0120.04211.98
5.3.20.0160.04211.76
5.3.10.0150.04211.72
5.3.00.0140.05111.71

preferences:
141.34 ms | 1394 KiB | 7 Q