3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_to_ten() { yield 1; yield 3 => 2; $cmd = ''; yield from [3, 4]; var_dump($cmd); if ($cmd == 't') { echo "close"; return false; } 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.0170.00316.25
8.3.50.0040.01116.58
8.3.40.0100.01018.79
8.3.30.0120.00318.42
8.3.20.0000.00720.25
8.3.10.0040.00423.48
8.3.00.0050.00317.59
8.2.180.0110.00418.41
8.2.170.0150.00722.96
8.2.160.0070.00720.35
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0000.00721.13
8.2.120.0040.00426.35
8.2.110.0090.01219.32
8.2.100.0000.01118.22
8.2.90.0030.00619.22
8.2.80.0050.00318.03
8.2.70.0030.00617.63
8.2.60.0050.00317.93
8.2.50.0040.00418.10
8.2.40.0050.00322.18
8.2.30.0050.00320.98
8.2.20.0050.00517.96
8.2.10.0000.00718.16
8.2.00.0040.00418.17
8.1.280.0130.00325.92
8.1.270.0080.00023.83
8.1.260.0050.00326.35
8.1.250.0090.00028.09
8.1.240.0030.00622.18
8.1.230.0090.00317.42
8.1.220.0080.00017.77
8.1.210.0050.00318.77
8.1.200.0050.00517.48
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0040.00418.63
8.1.160.0000.00719.01
8.1.150.0040.00420.71
8.1.140.0050.00219.56
8.1.130.0040.00418.99
8.1.120.0040.00417.44
8.1.110.0100.00017.47
8.1.100.0070.00417.36
8.1.90.0040.00417.48
8.1.80.0040.00317.43
8.1.70.0040.00417.49
8.1.60.0000.00717.62
8.1.50.0030.00617.55
8.1.40.0000.00817.47
8.1.30.0000.00817.67
8.1.20.0040.00417.66
8.1.10.0000.01017.59
8.1.00.0080.00017.57
8.0.300.0000.00818.77
8.0.290.0000.00916.63
8.0.280.0000.00818.45
8.0.270.0050.00417.30
8.0.260.0030.00316.83
8.0.250.0040.00416.88
8.0.240.0000.00816.80
8.0.230.0000.00816.85
8.0.220.0070.00016.82
8.0.210.0030.00316.95
8.0.200.0060.00016.82
8.0.190.0040.00416.88
8.0.180.0000.00716.80
8.0.170.0070.00016.87
8.0.160.0000.00816.87
8.0.150.0070.00016.72
8.0.140.0030.00416.85
8.0.130.0000.00613.38
8.0.120.0050.00316.91
8.0.110.0000.00716.78
8.0.100.0080.00016.94
8.0.90.0050.00316.72
8.0.80.0030.01216.79
8.0.70.0080.00016.76
8.0.60.0040.00416.80
8.0.50.0040.00417.00
8.0.30.0140.00417.06
8.0.20.0120.00817.40
8.0.10.0080.00016.88
8.0.00.0070.01117.06
7.4.330.0050.00015.55
7.4.320.0020.00516.59
7.4.300.0030.00316.41
7.4.290.0000.01016.55
7.4.280.0030.00516.49
7.4.270.0070.00016.58
7.4.260.0030.00316.49
7.4.250.0000.00916.54
7.4.240.0040.00416.46
7.4.230.0000.00616.35
7.4.220.0120.00616.42
7.4.210.0060.01416.50
7.4.200.0030.00516.48
7.4.160.0120.00716.53
7.4.150.0120.01217.40
7.4.140.0100.00917.86
7.4.130.0120.01216.49
7.4.120.0080.00816.45
7.4.110.0080.00816.38
7.4.100.0090.00916.32
7.4.90.0140.00316.68
7.4.80.0070.01419.39
7.4.70.0060.00916.54
7.4.60.0120.00316.48
7.4.50.0080.00416.21
7.4.40.0060.01616.63
7.4.30.0130.00916.39
7.4.00.0070.01014.79
7.3.330.0000.00613.41
7.3.320.0030.00313.30
7.3.310.0040.00416.26
7.3.300.0030.00316.36
7.3.290.0020.01416.34
7.3.280.0080.00816.37
7.3.270.0070.01117.40
7.3.260.0080.00816.76
7.3.250.0080.01216.25
7.3.240.0060.01116.49
7.3.230.0140.00616.76
7.3.210.0080.00816.65
7.3.200.0030.01316.55
7.3.190.0110.00516.25
7.3.180.0150.00616.40
7.3.170.0080.00916.34
7.3.160.0070.01016.31
7.3.120.0080.01014.89
7.3.110.0100.00814.85
7.3.100.0050.00714.92
7.3.90.0040.01014.91
7.3.80.0060.00815.06
7.3.70.0050.01014.84
7.3.60.0050.00814.96
7.3.50.0070.00714.62
7.3.40.0040.00714.80
7.3.30.0030.01214.90
7.3.20.0030.01016.72
7.3.10.0070.00716.58
7.3.00.0060.00816.56
7.2.330.0100.01016.86
7.2.320.0000.01616.49
7.2.310.0080.00916.79
7.2.300.0060.01816.66
7.2.290.0100.00716.61
7.2.250.0030.01715.23
7.2.240.0040.01515.11
7.2.230.0070.01015.17
7.2.220.0030.01214.89
7.2.210.0050.00514.88
7.2.200.0070.01015.11
7.2.190.0070.00715.02
7.2.180.0030.01015.00
7.2.170.0020.01614.88
7.2.160.0000.01614.96
7.2.150.0000.01616.66
7.2.140.0040.01116.78
7.2.130.0030.01016.82
7.2.120.0060.00917.04
7.2.110.0070.01017.04
7.2.100.0060.01016.97
7.2.90.0070.01016.95
7.2.80.0060.01016.93
7.2.70.0030.01416.70
7.2.60.0100.01116.82
7.2.50.0060.00916.92
7.2.40.0030.01416.75
7.2.30.0070.01017.02
7.2.20.0130.00317.00
7.2.10.0070.00317.01
7.2.00.0070.01016.81
7.1.330.0130.00215.90
7.1.320.0090.00715.78
7.1.310.0060.00615.84
7.1.300.0060.00415.82
7.1.290.0090.00515.57
7.1.280.0020.01415.72
7.1.270.0050.00915.70
7.1.260.0030.01015.78
7.1.250.0060.00916.01
7.1.200.0030.00615.79
7.1.100.0000.00918.05
7.1.70.0080.00917.38
7.1.60.0220.01635.02
7.1.50.0210.01534.72
7.1.40.0130.01634.42
7.1.30.0200.00934.40
7.1.20.0220.01534.61
7.1.10.0060.00616.68
7.1.00.0000.01716.72
7.0.200.0030.01416.90
7.0.190.0050.01416.64
7.0.180.0020.01416.18
7.0.170.0080.00916.00
7.0.160.0100.00916.22
7.0.150.0030.01016.20
7.0.140.0070.01416.13
7.0.130.0070.01116.42
7.0.120.0140.00516.39
7.0.110.0030.01316.52
7.0.100.0060.01116.39
7.0.90.0030.01316.39
7.0.80.0110.00516.66
7.0.70.0030.00916.34
7.0.60.0130.00316.25
7.0.50.0090.00616.16
7.0.40.0070.01116.67
7.0.30.0040.01416.42
7.0.20.0000.01516.68
7.0.10.0000.01316.48
7.0.00.0030.00916.35

preferences:
56.05 ms | 400 KiB | 5 Q