3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_to_ten() { $i = 1; $cmd = yield $i; if ($cmd == 't') { echo "close"; return false; } yield 3 => 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 "$k -> $num \n"; } echo $gen->getReturn(); echo $gen->send('t');

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.0130.00916.63
8.3.50.0120.00316.09
8.3.40.0150.00018.67
8.3.30.0040.01118.68
8.3.20.0080.00020.39
8.3.10.0080.00021.69
8.3.00.0000.00817.59
8.2.180.0150.00016.75
8.2.170.0150.00322.96
8.2.160.0070.00720.58
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00020.94
8.2.120.0070.00026.35
8.2.110.0060.00320.53
8.2.100.0040.00817.77
8.2.90.0040.00419.17
8.2.80.0080.00018.04
8.2.70.0070.00317.50
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0040.00420.63
8.2.30.0040.00419.13
8.2.20.0090.00017.94
8.2.10.0000.00718.00
8.2.00.0040.00417.99
8.1.280.0100.00725.92
8.1.270.0030.00622.14
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0110.00023.82
8.1.230.0080.00317.70
8.1.220.0050.00317.76
8.1.210.0090.00018.77
8.1.200.0000.00817.35
8.1.190.0060.00317.35
8.1.180.0000.00918.10
8.1.170.0060.00318.50
8.1.160.0030.00319.01
8.1.150.0040.00418.87
8.1.140.0040.00419.48
8.1.130.0000.00718.83
8.1.120.0040.00417.49
8.1.110.0060.00317.34
8.1.100.0040.00517.38
8.1.90.0030.00417.48
8.1.80.0000.00717.50
8.1.70.0030.00317.36
8.1.60.0080.00017.65
8.1.50.0000.00817.42
8.1.40.0060.00317.55
8.1.30.0000.00717.66
8.1.20.0000.00817.66
8.1.10.0000.00817.60
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0030.00318.39
8.0.270.0000.00817.25
8.0.260.0030.00316.72
8.0.250.0000.00616.88
8.0.240.0080.00016.84
8.0.230.0030.00616.90
8.0.220.0000.00716.85
8.0.210.0030.00316.77
8.0.200.0000.00716.97
8.0.190.0030.00616.86
8.0.180.0040.00416.78
8.0.170.0030.00316.94
8.0.160.0000.00816.93
8.0.150.0040.00416.78
8.0.140.0000.00716.73
8.0.130.0030.00313.25
8.0.120.0060.00316.73
8.0.110.0080.00016.88
8.0.100.0070.00016.73
8.0.90.0040.00416.68
8.0.80.0060.01616.82
8.0.70.0070.00016.77
8.0.60.0040.00416.90
8.0.50.0000.00816.86
8.0.30.0120.00616.98
8.0.20.0100.00917.40
8.0.10.0030.00416.87
8.0.00.0070.01716.50
7.4.330.0050.00015.55
7.4.320.0050.00216.64
7.4.300.0040.00416.51
7.4.290.0000.00716.53
7.4.280.0020.00516.63
7.4.270.0000.00716.64
7.4.260.0070.00016.44
7.4.250.0040.00416.36
7.4.240.0040.00416.56
7.4.230.0030.00316.62
7.4.220.0070.01816.45
7.4.210.0070.00716.54
7.4.200.0030.00416.38
7.4.160.0110.00416.39
7.4.150.0110.00717.40
7.4.140.0110.01017.86
7.4.130.0060.01416.44
7.4.120.0090.00916.43
7.4.110.0100.00616.49
7.4.100.0060.01216.62
7.4.90.0140.00416.41
7.4.80.0100.00619.39
7.4.70.0110.00616.46
7.4.60.0090.00916.41
7.4.50.0080.00816.49
7.4.40.0080.00916.45
7.4.30.0100.00716.60
7.4.00.0070.01015.21
7.3.330.0000.00513.18
7.3.320.0030.00213.19
7.3.310.0030.00316.46
7.3.300.0000.00716.24
7.3.290.0070.01016.31
7.3.280.0070.01016.34
7.3.270.0090.00917.40
7.3.260.0150.00816.42
7.3.250.0140.00616.40
7.3.240.0140.00316.38
7.3.230.0030.01416.33
7.3.210.0100.00716.20
7.3.200.0100.00616.50
7.3.190.0100.00616.36
7.3.180.0030.01316.34
7.3.170.0140.00716.60
7.3.160.0160.00616.50
7.2.330.0140.00316.73
7.2.320.0170.00716.45
7.2.310.0170.00716.67
7.2.300.0030.01916.58
7.2.290.0120.00616.57
7.2.60.0080.00016.97
7.2.00.0090.00019.41
7.1.200.0030.00615.75
7.1.100.0030.00817.95
7.1.70.0060.00717.01
7.1.60.0180.01735.27
7.1.50.0160.01934.92
7.1.40.0190.01834.45
7.1.30.0250.01234.46
7.1.20.0210.01034.69
7.1.10.0070.01216.48
7.1.00.0070.01016.69
7.0.200.0030.01316.61
7.0.190.0030.01316.55
7.0.180.0000.01816.24
7.0.170.0090.00716.05
7.0.160.0080.00816.34
7.0.150.0080.01016.18
7.0.140.0030.01316.26
7.0.130.0030.01316.45
7.0.120.0030.02016.41
7.0.110.0060.01116.47
7.0.100.0090.00916.29
7.0.90.0060.01216.45
7.0.80.0060.00716.46
7.0.70.0120.00616.29
7.0.60.0130.00315.92
7.0.50.0060.01016.40
7.0.40.0070.00616.49
7.0.30.0090.00616.37
7.0.20.0060.00816.58
7.0.10.0090.00816.46
7.0.00.0060.00916.35

preferences:
52.35 ms | 400 KiB | 5 Q