3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a () { print_r('I was here'); yield 1; yield 2; yield 3; } function b (iterable $i, string $name) { print_r($name); foreach($i as $it) { print_r($it); } print_r(PHP_EOL); print_r(PHP_EOL); } $it = a(); b((array) [1, 2, 3], '[1, 2, 3]'); b((array) 1, '1'); b((array) $it, 'a()'); print_r(array_map(fn ($message) => 'a', (array) $it));

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.5.30.0110.00718.07
8.5.20.0120.00619.24
8.5.10.0030.00516.55
8.5.00.0150.00720.15
8.4.180.0120.01019.72
8.4.170.0120.01323.77
8.4.160.0110.01323.89
8.4.150.0020.00014.05
8.4.140.0120.00917.29
8.4.130.0100.01017.68
8.4.120.0090.00920.64
8.4.110.0130.00718.82
8.4.100.0140.00817.92
8.4.90.0080.00417.71
8.4.80.0110.00919.46
8.4.70.0090.00717.69
8.4.60.0150.00619.30
8.4.50.0050.00319.35
8.4.40.0390.01017.51
8.4.30.0400.00817.60
8.4.20.0330.00817.70
8.4.10.0240.00317.47
8.3.300.0120.00820.85
8.3.290.0090.01018.48
8.3.280.0020.00014.05
8.3.270.0100.00916.60
8.3.260.0120.00816.59
8.3.250.0110.00718.90
8.3.240.0100.00816.58
8.3.230.0120.00716.93
8.3.220.0050.00316.73
8.3.210.0110.00716.51
8.3.200.0110.00316.59
8.3.190.0130.00616.48
8.3.180.0070.00816.59
8.3.170.0280.00516.61
8.3.160.0360.00716.49
8.3.150.0240.01016.50
8.3.140.0140.00716.35
8.3.130.0280.01216.42
8.3.120.0330.00616.29
8.3.110.0200.00916.21
8.3.100.0400.00716.42
8.3.90.0290.00816.16
8.3.80.0400.00816.47
8.3.70.0390.00716.34
8.3.60.0180.00216.49
8.3.50.0350.01016.61
8.3.40.0380.00717.50
8.3.30.0300.00817.49
8.3.20.0320.00917.42
8.3.10.0260.00717.43
8.3.00.0120.01317.50
8.2.300.0150.00718.07
8.2.290.0080.01119.16
8.2.280.0090.01016.84
8.2.270.0320.01016.39
8.2.260.0300.01016.34
8.2.250.0280.01116.55
8.2.240.0270.01316.43
8.2.230.0310.00816.42
8.2.220.0300.00816.25
8.2.210.0310.00816.60
8.2.200.0310.00816.47
8.2.190.0280.01116.48
8.2.180.0340.00616.52
8.2.170.0200.00517.91
8.2.160.0220.00217.68
8.2.150.0350.00717.34
8.2.140.0340.00717.54
8.2.130.0330.00817.41
8.2.120.0330.01017.53
8.2.110.0310.00817.26
8.2.100.0160.00317.64
8.2.90.0260.00517.72
8.2.80.0270.01117.47
8.2.70.0360.00517.35
8.2.60.0290.01017.45
8.2.50.0330.00917.41
8.2.40.0300.00917.65
8.2.30.0250.01217.61
8.2.20.0380.00717.07
8.2.10.0270.01117.33
8.2.00.0300.00817.62
8.1.340.0140.00718.21
8.1.320.0130.00816.03

preferences:
33.28 ms | 403 KiB | 5 Q