3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { echo "1\n"; $ret = (yield 'yield1'); echo 2."\n"; var_dump($ret); echo 3."\n"; $ret = (yield 'yield2'); echo 4."\n"; var_dump($ret); } $gen = gen(); var_dump($gen->current()); // string(6) "yield1" var_dump($gen->send('ret1')); // string(4) "ret1" (the first var_dump in gen) // string(6) "yield2" (the var_dump of the ->send() return value) var_dump($gen->send('ret2')); // string(4) "ret2" (again from within gen) // NULL (the return value of ->send())

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.250.0000.08019.00
5.4.240.0100.05318.93
5.4.230.0130.05318.96
5.4.220.0100.07718.89
5.4.210.0130.07318.95
5.4.200.0030.05318.84
5.4.190.0030.05718.91
5.4.180.0070.05318.88
5.4.170.0100.05018.90
5.4.160.0100.05018.95
5.4.150.0130.06718.88
5.4.140.0070.05016.38
5.4.130.0070.04716.47
5.4.120.0130.04716.43
5.4.110.0170.04016.36
5.4.100.0070.05316.59
5.4.90.0130.04316.43
5.4.80.0170.06716.48
5.4.70.0100.05016.43
5.4.60.0100.05016.46
5.4.50.0270.03716.48
5.4.40.0100.05016.36
5.4.30.0100.04716.30
5.4.20.0100.05016.28
5.4.10.0070.06016.30
5.4.00.0070.05015.92
5.3.280.0130.04714.68
5.3.270.0100.05014.68
5.3.260.0070.07714.68
5.3.250.0000.05714.68
5.3.240.0000.06014.69
5.3.230.0130.06714.67
5.3.220.0100.05714.74
5.3.210.0170.04714.39
5.3.200.0100.06014.65
5.3.190.0070.05314.55
5.3.180.0070.05014.73
5.3.170.0130.04314.55
5.3.160.0130.04714.55
5.3.150.0170.06714.55
5.3.140.0100.04714.53
5.3.130.0130.04714.53
5.3.120.0130.04714.77
5.3.110.0100.07314.61
5.3.100.0070.05314.00
5.3.90.0070.05014.01
5.3.80.0030.05314.18
5.3.70.0070.05013.98
5.3.60.0130.04314.07
5.3.50.0030.05314.17
5.3.40.0070.05013.77
5.3.30.0000.05313.92
5.3.20.0070.05013.70
5.3.10.0030.05013.71
5.3.00.0000.05313.63

preferences:
148.09 ms | 1394 KiB | 7 Q