3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public int $v; public function makeClosure(int $v) { return function () use ($v) { echo $this->v . '-' . $v . "\n"; throw new \Exception(); }; } } $foo = new Foo(); $foo->v = 2; $fx = $foo->makeClosure(3); try { $fx(); } catch (\Throwable $e) { print_r($e); }

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.00.0230.00516.74
8.4.150.0340.00919.84
8.4.140.0390.00817.62
8.4.130.0370.01017.75
8.4.120.0370.01017.82
8.4.110.0430.00817.86
8.4.100.0390.00717.92
8.4.90.0400.00417.89
8.4.80.0360.00917.86
8.4.70.0370.00917.85
8.4.60.0360.01317.72
8.4.50.0440.00718.00
8.4.40.0370.01017.73
8.4.30.0400.00817.74
8.4.20.0360.01217.85
8.4.10.0410.00917.67
8.3.280.0310.00818.15
8.3.270.0340.00916.43
8.3.260.0320.01016.73
8.3.250.0370.00716.60
8.3.240.0340.01016.73
8.3.230.0370.00616.79
8.3.220.0370.00916.73
8.3.210.0380.00716.80
8.3.200.0350.00916.48
8.3.190.0320.01116.54
8.3.180.0330.01216.80
8.3.170.0390.00916.59
8.3.160.0440.00516.73
8.3.150.0350.01116.52
8.3.140.0370.00916.77
8.3.130.0310.01016.85
8.3.120.0320.00916.68
8.3.110.0390.00716.53
8.3.100.0390.00716.45
8.3.90.0390.00816.71
8.3.80.0330.01316.44
8.3.70.0410.00916.71
8.3.60.0400.00916.79
8.3.50.0380.00816.72
8.3.40.0370.00718.04
8.3.30.0280.00917.93
8.3.20.0300.00817.86
8.3.10.0310.00517.64
8.3.00.0300.00817.91
8.2.290.0320.00816.70
8.2.280.0300.01016.53
8.2.270.0300.00916.83
8.2.260.0250.01316.47
8.2.250.0340.00716.50
8.2.240.0330.00816.73
8.2.230.0290.00916.48
8.2.220.0290.00916.60
8.2.210.0310.00716.41
8.2.200.0300.00816.55
8.2.190.0340.00616.49
8.2.180.0280.01016.67
8.2.170.0310.00718.03
8.2.160.0300.00718.08
8.2.150.0300.00618.00
8.2.140.0270.01017.75
8.2.130.0310.01217.59
8.2.120.0270.01018.04
8.2.110.0340.00418.03
8.2.100.0300.00818.04
8.2.90.0250.01317.98
8.2.80.0340.00418.04
8.2.70.0260.01117.80
8.2.60.0300.00718.04
8.2.50.0270.01217.66
8.2.40.0310.00617.86
8.2.30.0300.00917.62
8.2.20.0320.01417.48
8.2.10.0310.00917.91
8.2.00.0290.01117.77

preferences:
28.86 ms | 403 KiB | 5 Q