3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(ini_get('memory_limit')); echo "\n"; $shallowFiberFactoryFiber = new Fiber(function(): void { $fiberNumber = 0; while (true) { $res = new Fiber(function (\Closure $fx) use (&$fiberNumber): void { $res = $fx($fiberNumber++); Fiber::suspend($res); }); Fiber::suspend($res); } }); $shallowFiberFactoryFx = function () use ($shallowFiberFactoryFiber): \Fiber { return !$shallowFiberFactoryFiber->isStarted() ? $shallowFiberFactoryFiber->start() : $shallowFiberFactoryFiber->resume(); }; $i = 0; $fx = function (int $fiberNumber) use ($shallowFiberFactoryFx): void { $res = array_map(function ($str) use ($shallowFiberFactoryFx, $fiberNumber) { global $i, $fx; $i++; // log/debug execution if (($i % 1_000) === 0) { var_dump($i . ' at fiber: ' . $fiberNumber); } // terminating cond if ($i > 50_000) { return 'finished at fiber: ' . $fiberNumber; } // recurse - every 2k reentry unroll the machine stack using Fiber return ($i % 2_000) === 0 ? $shallowFiberFactoryFx()->start($fx)[0] : $fx($fiberNumber); }, ['x']); Fiber::suspend($res); }; $res = $shallowFiberFactoryFx()->start($fx); echo "\n"; print_r($res);

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.4.120.0550.02186.25
8.4.110.0570.02184.69
8.4.100.0960.01883.62
8.4.90.0560.02183.79
8.4.80.0570.01588.36
8.4.70.0430.01283.79
8.4.60.0620.02084.59
8.4.50.0540.01884.39
8.4.40.0450.01083.89
8.4.30.0490.02084.74
8.4.20.0330.01886.29
8.4.10.0420.01487.84
8.3.250.0460.01087.14
8.3.240.0520.01785.23
8.3.230.0680.02384.82
8.3.220.0650.01885.74
8.3.210.0560.02684.90
8.3.200.0410.01884.89
8.3.190.0470.02384.92
8.3.180.0660.01885.10
8.3.170.0570.02384.96
8.3.160.0700.01785.58
8.3.150.0590.02084.77
8.3.140.0580.03187.21
8.3.130.0650.02085.46
8.3.120.0660.01387.05
8.3.110.0300.01087.06
8.3.100.0720.01085.07
8.3.90.0460.01487.29
8.3.80.0270.01985.47
8.3.70.1220.02485.00
8.3.60.0830.05084.88
8.3.50.0690.02087.05
8.3.40.0320.02342.64
8.3.30.0330.01642.68
8.3.20.0140.01045.57
8.3.10.0190.00347.73
8.3.00.0110.01148.10
8.2.290.0460.01087.42
8.2.280.0530.01384.49
8.2.270.0660.01784.30
8.2.260.0540.01384.03
8.2.250.0530.01383.90
8.2.240.0530.02084.70
8.2.230.0400.02784.22
8.2.220.0430.01883.95
8.2.210.0610.01685.53
8.2.200.0720.02183.92
8.2.190.0710.03784.00
8.2.180.0810.03483.75
8.2.170.0440.00942.11
8.2.160.0580.00643.61
8.2.150.0270.00745.95
8.2.140.0260.01343.69
8.2.130.0110.00746.89
8.2.120.0350.01645.80
8.2.110.0200.01043.63
8.2.100.0260.01340.97
8.2.90.0110.01142.39
8.2.80.0130.01340.88
8.2.70.0160.00640.88
8.2.60.0190.00741.18
8.2.50.0150.00840.88
8.2.40.0150.01041.20
8.2.30.0140.00740.81
8.2.20.0130.01242.23
8.2.10.0200.00640.97
8.2.00.0120.01241.59
8.1.330.0630.01884.02
8.1.320.0680.01483.74
8.1.310.0630.02783.75
8.1.300.0440.00786.00
8.1.290.0460.01083.50
8.1.280.0900.03085.54
8.1.270.0130.00345.65
8.1.260.0130.01344.45
8.1.250.0100.00347.45
8.1.240.0210.00342.22
8.1.230.0230.01039.27
8.1.220.0070.01337.66
8.1.210.0130.00937.48
8.1.200.0110.01137.48
8.1.190.0160.00637.47
8.1.180.0140.01237.40
8.1.170.0210.00337.95
8.1.160.0130.01238.18
8.1.150.0190.00737.94
8.1.140.0200.00537.45
8.1.130.0140.01038.13
8.1.120.0130.01037.58
8.1.110.0170.00637.37
8.1.100.0150.00937.43
8.1.90.0150.00837.39
8.1.80.0160.00837.39
8.1.70.0230.00937.43
8.1.60.0220.00737.50
8.1.50.0210.00737.45
8.1.40.0190.00737.60
8.1.30.0200.00837.39
8.1.20.0230.01037.67
8.1.10.0460.02379.48
8.1.00.0320.02479.41
8.0.300.0080.00020.13
8.0.290.0000.00716.75
8.0.280.0090.00318.23
8.0.270.0080.00317.44
8.0.260.0080.00418.26
8.0.250.0070.00417.52
8.0.240.0100.00217.46
8.0.230.0030.00917.53
8.0.220.0040.00817.47
8.0.210.0090.00417.49
8.0.200.0040.00917.48
8.0.190.0070.00817.49
8.0.180.0120.00317.45
8.0.170.0130.00217.42
8.0.160.0100.00617.47
8.0.150.0140.00117.46
8.0.140.0060.01017.40
8.0.130.0100.00717.43
8.0.120.0110.00617.45
8.0.110.0150.00017.50
8.0.100.0080.00817.40
8.0.90.0090.00817.42
8.0.80.0100.00617.47
8.0.70.0150.00317.47
8.0.60.0130.00417.40
8.0.50.0020.01417.48
8.0.30.0100.00717.48
8.0.20.0110.00617.45
8.0.10.0120.00417.50
7.4.330.0060.00417.44
7.4.320.0090.00217.19
7.4.300.0110.00617.26
7.4.290.0140.00417.19
7.4.280.0070.01017.21
7.4.270.0130.00417.17
7.4.260.0140.00317.27
7.4.250.0060.00717.29
7.4.240.0110.00217.23
7.4.230.0040.00817.28
7.4.220.0060.00617.31
7.4.210.0060.00617.29
7.4.200.0100.00217.20
7.4.190.0100.00117.22
7.4.180.0110.00117.28
7.4.160.0080.00617.32
7.4.150.0080.00617.23
7.4.140.0130.00217.17
7.4.130.0110.00317.22
7.4.120.0100.00617.22
7.4.110.0120.00317.20
7.4.100.0110.00317.28
7.4.90.0100.00417.25
7.4.80.0090.00217.23
7.4.70.0100.00617.16
7.4.60.0100.00517.22
7.4.50.0110.00517.20
7.4.40.0140.00217.16
7.4.30.0100.00417.22
7.4.20.0050.01017.17
7.4.10.0110.00417.18
7.4.00.0110.00217.26

preferences:
27.09 ms | 403 KiB | 5 Q