3v4l.org

run code in 300+ PHP versions simultaneously
<?php $generator = (function() { $count = 3; echo "Start\n"; while(true) { yield; // suspend the function (the generator) echo "Are there results?\n"; $count--; if ($count === 0) { return; // We received the results, we stop } } })(); $generator->current(); // Initiates processing do { echo "Do something else\n"; $generator->next(); // Restart the function (resume at "yield") } while ($generator->valid()); // Has the function finished? echo "End\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)
8.4.120.0050.00325.93
8.4.110.0110.00918.11
8.4.100.0050.00517.64
8.4.90.0110.00920.82
8.4.80.0170.00919.09
8.4.70.0320.00718.21
8.4.60.0300.00618.07
8.4.50.0290.00718.04
8.4.40.0330.00817.73
8.4.30.0350.00717.78
8.4.20.0340.00717.78
8.4.10.0320.00617.67
8.3.250.0060.01319.04
8.3.240.0090.01018.58
8.3.230.0060.00316.63
8.3.220.0180.00617.77
8.3.210.0290.00617.17
8.3.200.0270.00617.13
8.3.190.0240.00617.18
8.3.180.0240.00517.26
8.3.170.0260.00517.33
8.3.160.0260.00517.23
8.3.150.0270.00517.36
8.3.140.0250.00517.31
8.3.130.0180.00517.13
8.3.120.0210.00517.19
8.3.110.0260.00517.16
8.3.100.0280.00717.09
8.3.90.0280.00717.15
8.3.80.0260.00517.13
8.3.70.0290.00617.40
8.3.60.0260.00717.21
8.3.50.0250.00517.35
8.3.40.0260.00417.77
8.3.30.0210.00517.78
8.3.20.0250.00617.68
8.3.10.0200.00617.69
8.3.00.0120.00517.95
8.2.290.0110.00920.23
8.2.280.0200.00517.17
8.2.270.0240.00617.16
8.2.260.0250.00517.08
8.2.250.0230.00617.42
8.2.240.0230.00617.13
8.2.230.0230.00717.28
8.2.220.0240.00617.19
8.2.210.0230.00617.09
8.2.200.0230.00617.09
8.2.190.0230.00517.13
8.2.180.0240.00517.31
8.2.170.0280.00617.82
8.2.160.0250.00517.80
8.2.150.0230.00617.80
8.2.140.0240.00517.71
8.2.130.0230.00517.70
8.2.120.0240.00717.79
8.2.110.0280.00617.73
8.2.100.0270.00618.03
8.2.90.0260.00717.82
8.2.80.0250.00617.69
8.2.70.0250.00618.00
8.2.60.0280.00517.72
8.2.50.0270.00717.65
8.2.40.0280.00717.74
8.2.30.0270.00717.72
8.2.20.0260.00817.71
8.2.10.0260.00617.72
8.2.00.0250.00517.78

preferences:
26.76 ms | 403 KiB | 5 Q