3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo1() { // resource intensive tasks: yield 1; yield 1.1; yield 1.2 yield 2; yield 3; } function wrapItWithADifferentApi() { foreach(foo1() as $foo) { if($foo >= 2) { return; } yield $foo; } } foreach(wrapItWithADifferentApi() as $foo) { var_dump($foo); }

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.6.70.3200.03720.47
5.4.390.0230.05718.80
5.4.380.0230.05718.70
5.4.370.0270.05018.52
5.4.360.0200.06018.80
5.4.350.0170.06318.65
5.4.340.0300.06718.81
5.4.320.0200.05718.78
5.4.310.0100.06318.68
5.4.300.0200.06018.85
5.4.290.0200.05018.50
5.4.280.0230.04718.80
5.4.270.0170.05318.60
5.4.260.0230.05318.69
5.4.250.0270.07018.83
5.4.240.0270.05318.60
5.4.230.0270.04318.45
5.4.220.0300.04718.73
5.4.210.0300.06718.82
5.4.200.0230.05016.79
5.4.190.0270.04318.82
5.4.180.0130.06318.75
5.4.170.0200.05318.82
5.4.160.0230.06018.74
5.4.150.0170.05318.79
5.4.140.0100.06716.44
5.4.130.0200.04716.33
5.4.120.0130.05716.16
5.4.110.0170.05016.25
5.4.100.0130.06016.29
5.4.90.0200.04716.27
5.4.80.0170.05016.27
5.4.70.0130.06016.25
5.4.60.0170.05716.20
5.4.50.0170.05316.14
5.4.40.0130.05716.29
5.4.30.0130.06316.38
5.4.20.0130.05316.21
5.4.10.0300.04016.26
5.4.00.0200.04715.62
5.3.290.0200.05314.76
5.3.280.0130.05714.73
5.3.270.0130.06714.74
5.3.260.0230.05014.71
5.3.250.0370.04014.63
5.3.240.0130.06014.75
5.3.230.0300.04014.73
5.3.220.0100.06314.77
5.3.210.0130.05714.62
5.3.200.0170.05014.61
5.3.190.0230.05014.68
5.3.180.0230.05014.73
5.3.170.0100.07714.79
5.3.160.0130.06014.60
5.3.150.0170.06314.73
5.3.140.0200.05014.58
5.3.130.0200.06714.60
5.3.120.0200.07014.66
5.3.110.0270.05014.75
5.3.100.0170.05014.24
5.3.90.0200.05714.02
5.3.80.0230.05314.08
5.3.70.0270.05014.18
5.3.60.0230.04714.07
5.3.50.0230.04313.93
5.3.40.0100.05714.05
5.3.30.0270.04314.03
5.3.20.0130.05713.73
5.3.10.0230.04713.78
5.3.00.0230.04313.68
5.2.170.0200.05311.19
5.2.160.0170.04011.18
5.2.150.0130.04011.20
5.2.140.0170.04311.18
5.2.130.0170.04011.17
5.2.120.0130.04011.20
5.2.110.0270.03011.10
5.2.100.0130.05011.10
5.2.90.0230.03311.32
5.2.80.0130.04311.08
5.2.70.0170.04011.14
5.2.60.0130.04011.10
5.2.50.0130.03711.05
5.2.40.0100.03711.20
5.2.30.0100.04010.98
5.2.20.0100.03711.02
5.2.10.0100.04310.88
5.2.00.0200.04710.89
5.1.60.0130.0309.98
5.1.50.0170.0279.98
5.1.40.0130.03310.00
5.1.30.0130.04010.41
5.1.20.0100.04310.53
5.1.10.0100.03710.17
5.1.00.0100.03710.11
5.0.50.0070.0308.58
5.0.40.0070.0308.43
5.0.30.0070.0438.26
5.0.20.0070.0278.28
5.0.10.0070.0278.38
5.0.00.0100.0408.19
4.4.90.0100.0175.90
4.4.80.0030.0235.87
4.4.70.0000.0275.91
4.4.60.0070.0205.88
4.4.50.0100.0175.88
4.4.40.0030.0375.99
4.4.30.0130.0135.91
4.4.20.0030.0235.98
4.4.10.0100.0205.94
4.4.00.0070.0335.95
4.3.110.0070.0235.84
4.3.100.0030.0235.79
4.3.90.0100.0275.79
4.3.80.0130.0375.79
4.3.70.0070.0205.79
4.3.60.0070.0205.84
4.3.50.0130.0135.78
4.3.40.0070.0335.75
4.3.30.0030.0234.91
4.3.20.0070.0204.91
4.3.10.0030.0234.91
4.3.00.0030.0307.09

preferences:
145.35 ms | 1398 KiB | 7 Q