3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_to_ten() { yield 1; yield 2; yield from [3, 4]; yield from new ArrayIterator([5, 6]); yield from seven_eight(); return yield from nine_ten(); } function seven_eight() { yield 7; yield from eight(); } function eight() { yield 8; } function nine_ten() { yield 9; return 10; } $gen = count_to_ten(); foreach ($gen as $k => $num) { echo "\n-$k -> $num \n"; echo $gen->send('t'); } var_dump( $gen->getReturn());

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.3.40.0110.00418.52
8.3.30.0060.00918.71
8.3.20.0000.00820.34
8.3.10.0040.00423.52
8.3.00.0030.00717.78
8.2.170.0140.00722.96
8.2.160.0140.00020.57
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00420.91
8.2.120.0030.00626.35
8.2.110.0030.00620.94
8.2.100.0060.00617.74
8.2.90.0100.00317.36
8.2.80.0060.00317.97
8.2.70.0000.00817.93
8.2.60.0040.00418.03
8.2.50.0000.00818.10
8.2.40.0040.00419.43
8.2.30.0040.00420.50
8.2.20.0060.00317.94
8.2.10.0030.00618.07
8.2.00.0040.00418.11
8.1.270.0020.00522.01
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0120.00020.44
8.1.230.0110.00019.61
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0000.00817.35
8.1.190.0050.00317.35
8.1.180.0060.00318.10
8.1.170.0030.00618.69
8.1.160.0040.00422.04
8.1.150.0080.00018.84
8.1.140.0000.00719.57
8.1.130.0070.00018.89
8.1.120.0040.00417.36
8.1.110.0040.00717.52
8.1.100.0050.00417.52
8.1.90.0000.00817.37
8.1.80.0070.00017.49
8.1.70.0030.00317.50
8.1.60.0000.00817.47
8.1.50.0040.00417.54
8.1.40.0040.00417.54
8.1.30.0000.00717.65
8.1.20.0070.00017.50
8.1.10.0040.00417.51
8.1.00.0080.00017.49
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0040.00718.40
8.0.270.0070.00417.17
8.0.260.0030.00316.75
8.0.250.0070.00016.96
8.0.240.0070.00016.86
8.0.230.0040.00416.95
8.0.220.0000.00716.98
8.0.210.0070.00016.86
8.0.200.0070.00016.94
8.0.190.0030.00516.99
8.0.180.0000.00816.92
8.0.170.0070.00016.88
8.0.160.0040.00416.79
8.0.150.0040.00416.86
8.0.140.0000.00716.90
8.0.130.0000.00513.31
8.0.120.0080.00016.86
8.0.110.0070.00016.92
8.0.100.0050.00216.92
8.0.90.0040.00416.86
8.0.80.0060.00916.85
8.0.70.0020.00516.79
8.0.60.0030.00616.88
8.0.50.0040.00416.96
8.0.30.0050.01417.12
8.0.20.0130.01017.40
8.0.10.0030.00517.08
8.0.00.0090.00916.79
7.4.330.0000.00515.55
7.4.320.0030.00316.52
7.4.300.0060.00016.57
7.4.290.0070.00316.59
7.4.280.0000.00816.63
7.4.270.0030.00316.50
7.4.260.0040.00416.58
7.4.250.0030.00316.45
7.4.240.0030.00616.58
7.4.230.0000.00716.68
7.4.220.0130.01316.62
7.4.210.0090.00616.40
7.4.200.0030.00516.61
7.4.160.0110.00516.48
7.4.150.0070.01017.40
7.4.140.0080.01217.86
7.4.130.0090.00916.52
7.4.120.0090.00816.57
7.4.110.0080.00816.46
7.4.100.0120.00616.46
7.4.90.0060.01616.68
7.4.80.0120.01019.39
7.4.70.0070.01016.48
7.4.60.0070.01016.41
7.4.50.0030.01316.52
7.4.40.0030.01316.54
7.4.30.0060.00916.66
7.4.00.0120.00414.67
7.3.330.0030.00313.39
7.3.320.0000.00513.23
7.3.310.0030.00316.34
7.3.300.0030.00316.23
7.3.290.0080.00716.37
7.3.280.0070.01016.33
7.3.270.0110.00517.40
7.3.260.0030.01316.52
7.3.250.0090.01116.50
7.3.240.0060.01116.51
7.3.230.0100.00916.52
7.3.210.0110.00716.38
7.3.200.0060.00916.40
7.3.190.0110.00516.51
7.3.180.0090.00616.29
7.3.170.0080.00816.33
7.3.160.0040.01816.45
7.3.120.0060.00917.15
7.3.110.0120.00317.15
7.3.100.0060.00317.15
7.3.90.0110.00417.15
7.3.80.0060.00317.15
7.3.70.0090.00617.15
7.3.60.0060.00317.15
7.3.50.0060.01017.15
7.3.40.0040.00717.15
7.3.30.0030.00617.15
7.3.20.0100.00017.15
7.3.10.0130.00317.15
7.3.00.0000.00917.15
7.2.330.0110.00716.54
7.2.320.0140.00716.74
7.2.310.0060.01116.64
7.2.300.0120.00616.54
7.2.290.0030.01316.43
7.2.240.0030.00517.15
7.2.230.0040.01417.15
7.2.220.0070.00717.15
7.2.210.0040.00817.15
7.2.200.0060.00617.15
7.2.190.0080.00817.15
7.2.180.0000.01617.15
7.2.170.0100.00717.15
7.2.160.0040.01517.15
7.2.150.0040.01117.15
7.2.140.0030.00617.15
7.2.130.0090.00617.15
7.2.120.0000.01617.15
7.2.110.0040.01117.15
7.2.100.0040.01117.15
7.2.90.0080.00817.15
7.2.80.0030.01317.15
7.2.70.0030.00917.15
7.2.60.0060.00817.02
7.2.50.0030.00617.15
7.2.40.0030.01517.15
7.2.30.0120.00317.15
7.2.20.0120.00017.15
7.2.10.0000.01417.15
7.2.00.0030.01118.12
7.1.330.0090.00317.15
7.1.320.0080.00917.15
7.1.310.0030.01017.15
7.1.300.0030.01317.15
7.1.290.0000.01517.15
7.1.280.0100.00317.15
7.1.270.0100.00617.15
7.1.260.0090.00617.15
7.1.250.0000.01217.15
7.1.200.0190.01115.63
7.1.100.0080.00318.23
7.1.70.0060.00917.19
7.1.60.0220.00635.03
7.1.50.0200.01734.90
7.1.40.0220.00934.30
7.1.30.0170.01434.48
7.1.20.0190.01334.51
7.1.10.0030.01316.39
7.1.00.0040.01616.70
7.0.200.0050.01216.82
7.0.190.0100.00716.57
7.0.180.0110.00316.25
7.0.170.0100.00316.20
7.0.160.0000.01716.31
7.0.150.0000.01316.15
7.0.140.0050.00816.07
7.0.130.0060.00916.28
7.0.120.0070.00716.73
7.0.110.0030.01316.37
7.0.100.0070.01316.39
7.0.90.0040.01616.34
7.0.80.0120.00316.59
7.0.70.0090.00916.34
7.0.60.0060.01216.05
7.0.50.0000.01416.38
7.0.40.0080.00816.50
7.0.30.0000.01516.40
7.0.20.0060.00916.44
7.0.10.0060.00916.41
7.0.00.0090.00716.41

preferences:
44.48 ms | 400 KiB | 5 Q