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.60.0100.01016.50
8.3.50.0110.00416.41
8.3.40.0040.01118.67
8.3.30.0070.00718.42
8.3.20.0000.00720.35
8.3.10.0040.00423.65
8.3.00.0100.00017.48
8.2.180.0150.00016.63
8.2.170.0070.00722.96
8.2.160.0070.00720.22
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.69
8.2.110.0000.01020.94
8.2.100.0120.00018.09
8.2.90.0040.00419.22
8.2.80.0060.00318.05
8.2.70.0080.00017.50
8.2.60.0050.00318.05
8.2.50.0040.00418.10
8.2.40.0000.00720.55
8.2.30.0040.00420.95
8.2.20.0030.00617.99
8.2.10.0040.00418.11
8.2.00.0060.00318.13
8.1.280.0070.00725.92
8.1.270.0070.00023.83
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0110.00419.16
8.1.220.0000.00817.75
8.1.210.0040.00418.77
8.1.200.0040.00717.47
8.1.190.0050.00317.23
8.1.180.0030.00618.10
8.1.170.0080.00018.59
8.1.160.0000.00718.95
8.1.150.0040.00420.67
8.1.140.0000.00719.58
8.1.130.0000.00718.81
8.1.120.0040.00417.38
8.1.110.0020.00917.46
8.1.100.0060.00317.45
8.1.90.0040.00417.37
8.1.80.0000.00717.44
8.1.70.0030.00317.39
8.1.60.0040.00417.61
8.1.50.0040.00417.54
8.1.40.0000.00817.43
8.1.30.0000.00717.48
8.1.20.0040.00417.65
8.1.10.0080.00017.52
8.1.00.0040.00417.53
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0000.00718.45
8.0.270.0030.00717.25
8.0.260.0040.00416.74
8.0.250.0060.00016.99
8.0.240.0040.00416.98
8.0.230.0060.00317.00
8.0.220.0030.00316.79
8.0.210.0030.00316.90
8.0.200.0060.00016.93
8.0.190.0040.00416.96
8.0.180.0030.00516.95
8.0.170.0030.00316.80
8.0.160.0070.00016.84
8.0.150.0040.00416.86
8.0.140.0070.00016.84
8.0.130.0000.00513.31
8.0.120.0040.00416.82
8.0.110.0000.00716.69
8.0.100.0070.00016.88
8.0.90.0000.00716.94
8.0.80.0060.01016.85
8.0.70.0000.00716.87
8.0.60.0040.00416.93
8.0.50.0060.00316.85
8.0.30.0080.01017.11
8.0.20.0080.01117.40
8.0.10.0040.00416.88
8.0.00.0110.00616.81
7.4.330.0000.00515.55
7.4.320.0060.00016.37
7.4.300.0030.00316.42
7.4.290.0030.00616.52
7.4.280.0070.00016.39
7.4.270.0040.00416.42
7.4.260.0000.00716.58
7.4.250.0080.00016.56
7.4.240.0000.00716.36
7.4.230.0000.00716.32
7.4.220.0090.00916.41
7.4.210.0120.00316.63
7.4.200.0050.00216.39
7.4.160.0090.00716.59
7.4.150.0130.00317.40
7.4.140.0090.01017.86
7.4.130.0160.00316.54
7.4.120.0080.01016.52
7.4.110.0080.00816.41
7.4.100.0070.01016.61
7.4.90.0000.01816.27
7.4.80.0140.00719.39
7.4.70.0030.01216.63
7.4.60.0090.00916.68
7.4.50.0070.00716.66
7.4.40.0060.01016.56
7.4.30.0140.00416.33
7.4.00.0110.00414.72
7.3.330.0000.00513.23
7.3.320.0050.00013.41
7.3.310.0070.00016.23
7.3.300.0070.00016.36
7.3.290.0050.00916.33
7.3.280.0090.00816.34
7.3.270.0000.01817.40
7.3.260.0140.00716.54
7.3.250.0160.00516.49
7.3.240.0110.00716.42
7.3.230.0060.01116.39
7.3.210.0040.01116.44
7.3.200.0000.01516.33
7.3.190.0070.00716.64
7.3.180.0140.00316.28
7.3.170.0100.01016.27
7.3.160.0130.00316.33
7.2.330.0150.00716.77
7.2.320.0080.00816.71
7.2.310.0060.01216.70
7.2.300.0060.01216.76
7.2.290.0070.01016.68
7.2.60.0190.00416.87
7.1.200.0060.00615.56
7.1.100.0000.00918.43
7.1.70.0060.01017.02
7.1.60.0140.01335.07
7.1.50.0230.01334.49
7.1.40.0130.02234.14
7.1.30.0220.01234.34
7.1.20.0200.01434.41
7.1.10.0030.01316.48
7.1.00.0080.00816.78
7.0.200.0060.01016.82
7.0.190.0070.00716.50
7.0.180.0040.01016.16
7.0.170.0030.01316.11
7.0.160.0040.01216.33
7.0.150.0060.01016.40
7.0.140.0140.00016.35
7.0.130.0050.00916.57
7.0.120.0100.00316.43
7.0.110.0100.00416.34
7.0.100.0000.01516.33
7.0.90.0110.00616.45
7.0.80.0030.01316.27
7.0.70.0080.00716.24
7.0.60.0090.00816.25
7.0.50.0070.01016.25
7.0.40.0030.01016.38
7.0.30.0060.00616.38
7.0.20.0000.01316.30
7.0.10.0080.00516.36
7.0.00.0030.01016.38

preferences:
24.55 ms | 400 KiB | 5 Q