3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = 0; function funsimple() { global $i; if (($i++ % 2_000) === 0) { var_dump($i); } funsimple(); } function fun() { array_map(function ($str) { global $i; if (($i++ % 2_000) === 0) { var_dump($i); } fun(); }, ['x']); } $fx = function () use (&$fx, &$i) { array_map(function ($str) use ($fx, &$i) { if (($i++ % 2_000) === 0) { var_dump($i); } $fx(); }, ['x']); }; // funsimple(); // this produces correctly OOM error // this produces segfault fun(); // $fx(); // using anonymous function, the behaviour is the same

Abusive script

This script was stopped while abusing our resources

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.40.0460.00961.88
8.4.30.0530.01262.59
8.4.20.0510.01264.34
8.4.10.0540.01065.89
8.3.160.0780.01162.76
8.3.150.0640.02262.79
8.3.140.0500.01562.09
8.3.130.0330.01663.03
8.3.120.0650.01064.58
8.3.110.0540.01464.04
8.3.100.0470.01762.41
8.3.90.0250.04963.86
8.3.80.0620.00962.39
8.3.70.0660.02562.24
8.3.60.0830.02262.28
8.3.50.0660.03964.32
8.3.40.0420.01048.03
8.3.30.0500.01047.96
8.3.20.0130.01351.10
8.3.10.0040.01851.34
8.3.00.0140.01151.21
8.2.270.0150.00638.12
8.2.260.0270.02037.52
8.2.250.0170.00337.71
8.2.240.0160.01038.06
8.2.230.0220.00037.75
8.2.220.0360.00737.54
8.2.210.0120.00939.38
8.2.200.0230.00737.61
8.2.190.0380.01037.63
8.2.180.0170.01038.45
8.2.170.0360.00340.04
8.2.160.0220.01242.08
8.2.150.0140.00741.88
8.2.140.0200.00341.95
8.2.130.0340.00741.89
8.2.120.0160.00042.18
8.2.110.0140.00742.18
8.2.100.0340.00739.28
8.2.90.0110.01139.13
8.2.80.0160.00340.28
8.2.70.0130.00639.00
8.2.60.0160.00338.88
8.2.50.0160.00339.00
8.2.40.0100.01039.69
8.2.30.0120.00639.61
8.2.20.0100.00742.07
8.2.10.0110.00739.57
8.2.00.0120.00640.74
8.1.310.0350.00441.16
8.1.300.0170.00743.09
8.1.290.0240.00340.65
8.1.280.0320.01042.16
8.1.270.0100.00647.81
8.1.260.0160.00346.68
8.1.250.0130.00347.83
8.1.240.0070.01446.37
8.1.230.0330.01343.39
8.1.220.0090.01342.16
8.1.210.0120.00941.73
8.1.200.0100.01341.73
8.1.190.0240.00341.60
8.1.180.0090.01241.72
8.1.170.0140.00741.38
8.1.160.0110.00743.37
8.1.150.0070.01343.07
8.1.140.0150.00441.89
8.1.130.0040.01443.41
8.1.120.0140.00341.93
8.1.110.0040.01541.95
8.1.100.0070.01141.91
8.1.90.0140.00441.91
8.1.80.0110.00741.96
8.1.70.0160.00341.89
8.1.60.0240.00342.04
8.1.50.0260.00042.01
8.1.40.0170.00741.99
8.1.30.0230.00042.07
8.1.20.0160.00642.12
8.1.10.0210.00341.91
8.1.00.0270.00341.88
8.0.300.0110.00941.16
8.0.290.0200.00038.13
8.0.280.0170.00040.03
8.0.270.0100.00738.39
8.0.260.0130.00340.04
8.0.250.0120.00638.55
8.0.240.0100.00638.42
8.0.230.0100.00738.43
8.0.220.0070.01138.26
8.0.210.0070.01038.34
8.0.200.0240.00038.35
8.0.190.0190.00538.44
8.0.180.0230.00338.48
8.0.170.0210.00438.31
8.0.160.0240.00038.37
8.0.150.0230.00038.27
8.0.140.0200.00438.38
8.0.130.0180.00638.25
8.0.120.0180.00738.44
8.0.110.0180.00638.31
8.0.100.0090.00938.31
8.0.90.0160.00438.38
8.0.80.0100.01038.33
8.0.70.0130.00538.38
8.0.60.0160.00838.33
8.0.50.0210.00338.38
8.0.30.0250.00038.29
8.0.20.0110.01438.34
8.0.10.0160.00838.38
7.4.330.0050.00835.67
7.4.320.0120.00338.72
7.4.300.0150.01138.59
7.4.290.0170.01038.80
7.4.280.0170.01038.75
7.4.270.0120.01538.57
7.4.260.0150.00938.68
7.4.250.0190.00638.73
7.4.240.0150.01138.75
7.4.230.0190.00638.62
7.4.220.0120.01238.73
7.4.210.0140.01038.68
7.4.200.0170.00738.65
7.4.190.0190.00338.64
7.4.180.0140.00938.79
7.4.160.0180.00738.73
7.4.150.0160.00838.71
7.4.140.0170.00738.63
7.4.130.0110.01138.71
7.4.120.0130.00738.66
7.4.110.0110.00838.64
7.4.100.0100.01038.77
7.4.90.0160.00938.71
7.4.80.0140.00738.72
7.4.70.0060.01338.63
7.4.60.0130.00738.68
7.4.50.0190.00338.64
7.4.40.0200.00338.66
7.4.30.0180.00038.56
7.4.20.0200.00038.69
7.4.10.0160.00438.71
7.4.00.0110.00738.85

preferences:
89.56 ms | 403 KiB | 5 Q