3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_to_ten() { yield 1; yield 3 => 2; $cmd = yield from [3, 4]; if ($cmd == 't') { echo "close"; return false; } yield 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 "$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.0030.01316.63
8.3.50.0090.00916.30
8.3.40.0100.00618.42
8.3.30.0060.00918.75
8.3.20.0040.00420.29
8.3.10.0000.00823.48
8.3.00.0050.00317.45
8.2.180.0150.00016.63
8.2.170.0140.00722.96
8.2.160.0000.02020.35
8.2.150.0000.00824.18
8.2.140.0090.00024.66
8.2.130.0040.00421.00
8.2.120.0080.00026.35
8.2.110.0080.00622.08
8.2.100.0040.00818.09
8.2.90.0030.00519.08
8.2.80.0040.00418.03
8.2.70.0060.00317.63
8.2.60.0030.00518.05
8.2.50.0070.00318.10
8.2.40.0050.00322.20
8.2.30.0040.00421.04
8.2.20.0000.00817.95
8.2.10.0040.00417.99
8.2.00.0050.00318.09
8.1.280.0140.00325.92
8.1.270.0040.00423.76
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.84
8.1.230.0060.00617.45
8.1.220.0080.00017.74
8.1.210.0060.00318.77
8.1.200.0060.00317.13
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0030.00618.49
8.1.160.0040.00419.03
8.1.150.0000.00920.68
8.1.140.0040.00419.67
8.1.130.0030.00318.81
8.1.120.0060.00317.50
8.1.110.0080.00317.30
8.1.100.0070.00317.36
8.1.90.0060.00317.50
8.1.80.0060.00317.44
8.1.70.0000.00717.50
8.1.60.0000.00817.58
8.1.50.0040.00417.44
8.1.40.0000.00717.54
8.1.30.0040.00417.49
8.1.20.0050.00317.59
8.1.10.0040.00417.57
8.1.00.0030.00517.45
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0000.00718.50
8.0.270.0070.00016.82
8.0.260.0030.00316.87
8.0.250.0030.00316.97
8.0.240.0000.00916.96
8.0.230.0060.00316.94
8.0.220.0050.00316.79
8.0.210.0040.00416.83
8.0.200.0000.00717.02
8.0.190.0040.00416.93
8.0.180.0050.00316.80
8.0.170.0070.00016.88
8.0.160.0030.00317.01
8.0.150.0000.00716.75
8.0.140.0020.00516.85
8.0.130.0030.00313.29
8.0.120.0040.00416.83
8.0.110.0000.00716.92
8.0.100.0000.00716.89
8.0.90.0050.00216.88
8.0.80.0060.00916.93
8.0.70.0000.00716.95
8.0.60.0080.00016.76
8.0.50.0000.00716.79
8.0.30.0050.01017.18
8.0.20.0090.01117.40
8.0.10.0040.00417.02
8.0.00.0120.00616.71
7.4.330.0020.00215.55
7.4.320.0060.00016.60
7.4.300.0060.00016.41
7.4.290.0030.00616.61
7.4.280.0000.00716.46
7.4.270.0070.00016.65
7.4.260.0030.00316.49
7.4.250.0040.00416.57
7.4.240.0070.00016.50
7.4.230.0030.00316.49
7.4.220.0090.01016.47
7.4.210.0060.00816.71
7.4.200.0000.00716.56
7.4.160.0080.00716.49
7.4.150.0090.00917.40
7.4.140.0090.01017.86
7.4.130.0110.00716.44
7.4.120.0120.00916.54
7.4.110.0100.00716.32
7.4.100.0130.00416.64
7.4.90.0110.00516.57
7.4.80.0120.00619.39
7.4.70.0070.01116.52
7.4.60.0090.00616.51
7.4.50.0000.01916.43
7.4.40.0170.00016.32
7.4.30.0100.00716.54
7.4.00.0040.01114.80
7.3.330.0050.00013.23
7.3.320.0000.00613.37
7.3.310.0000.00716.21
7.3.300.0000.00616.34
7.3.290.0060.00716.40
7.3.280.0110.00516.35
7.3.270.0040.01517.40
7.3.260.0100.00716.41
7.3.250.0110.00916.42
7.3.240.0070.00916.46
7.3.230.0110.00616.57
7.3.210.0070.01016.43
7.3.200.0130.00316.46
7.3.190.0110.00516.56
7.3.180.0100.00616.51
7.3.170.0100.01016.68
7.3.160.0100.00616.70
7.3.10.0090.00616.48
7.3.00.0000.01216.39
7.2.330.0140.00316.66
7.2.320.0030.01316.79
7.2.310.0120.00616.52
7.2.300.0120.00916.72
7.2.290.0120.00616.63
7.2.130.0070.01417.02
7.2.120.0060.00916.73
7.2.110.0030.00916.94
7.2.100.0090.00616.80
7.2.90.0030.00916.66
7.2.80.0030.01016.52
7.2.70.0060.00916.77
7.2.60.0050.00916.97
7.2.50.0070.00416.93
7.2.40.0100.00017.01
7.2.30.0040.01416.94
7.2.20.0070.01016.77
7.2.10.0120.00616.81
7.2.00.0080.00918.11
7.1.250.0000.01515.41
7.1.200.0070.00715.63
7.1.100.0040.00818.20
7.1.70.0000.01217.07
7.1.60.0170.01435.09
7.1.50.0130.01334.73
7.1.40.0200.00734.14
7.1.30.0040.02434.42
7.1.20.0150.01834.45
7.1.10.0070.00716.58
7.1.00.0040.01116.70
7.0.200.0040.01116.73
7.0.190.0070.00616.64
7.0.180.0060.00816.20
7.0.170.0050.01116.18
7.0.160.0030.01316.37
7.0.150.0100.00316.20
7.0.140.0040.01116.46
7.0.130.0030.01316.64
7.0.120.0090.00616.46
7.0.110.0040.01116.09
7.0.100.0030.01216.26
7.0.90.0000.01616.23
7.0.80.0030.01016.59
7.0.70.0080.00816.21
7.0.60.0030.01416.02
7.0.50.0000.01716.39
7.0.40.0000.01616.37
7.0.30.0030.01316.68
7.0.20.0030.01316.36
7.0.10.0030.01316.34
7.0.00.0040.01216.43

preferences:
51.5 ms | 401 KiB | 5 Q