3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); /** * @template TReturn * @param Closure(): TReturn $closure * @param 'static'|class-string|object $newScope * @return Closure(): TReturn */ function bind(Closure $closure, string|object $newScope = 'static'): Closure { /** @var ?Closure(): TReturn */ $boundClosure = $closure->bindTo(null, $newScope); assert($boundClosure !== null, 'Failed to bind closure.'); return $boundClosure; } final class Vault { public function __construct( private readonly string $secret, ) { } } $vault = new Vault('https://disk.yandex.ru/i/OG-9MXrogsS05g'); $secretAccessor = bind(static fn (): string => $vault->secret, $vault); $secret = $secretAccessor(); var_dump($secret);

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.10.0040.00420.13
8.5.00.0100.01320.20
8.4.160.0080.01323.84
8.4.150.0030.00014.05
8.4.140.0130.00817.77
8.4.130.0120.00717.87
8.4.120.0100.01024.04
8.4.110.0130.00820.94
8.4.100.0140.00818.66
8.4.90.0100.00919.07
8.4.80.0080.00918.71
8.4.70.0130.00717.84
8.4.60.0090.01118.61
8.4.50.0040.00519.46
8.4.40.0100.01017.92
8.4.30.0150.00620.61
8.4.20.0100.01017.99
8.4.10.0030.00623.75
8.3.290.0080.01220.91
8.3.280.0100.01118.31
8.3.270.0120.00916.64
8.3.260.0090.00916.57
8.3.250.0100.01018.87
8.3.240.0110.00817.10
8.3.230.0130.00716.88
8.3.220.0100.00719.17
8.3.210.0120.00316.90
8.3.200.0040.00516.53
8.3.190.0060.00217.41
8.3.180.0100.00816.60
8.3.170.0070.01117.04
8.3.160.0140.00419.15
8.3.150.0070.01017.18
8.3.140.0140.00320.59
8.3.130.0030.00518.51
8.3.120.0030.00620.66
8.3.110.0060.00322.58
8.3.100.0070.00422.58
8.3.90.0120.00822.58
8.3.50.0060.00622.58
8.2.300.0140.00618.07
8.2.290.0090.00920.63
8.2.280.0100.01020.03
8.2.270.0060.01216.62
8.2.260.0090.00917.01
8.2.250.0030.00516.86
8.2.240.0100.00018.92
8.2.230.0030.00722.58
8.2.220.0030.00622.58
8.2.210.0060.00922.58
8.2.50.0030.00618.10
8.2.40.0080.00818.10
8.2.30.0100.00518.10
8.2.20.0030.00618.10
8.2.10.0080.00517.85
8.2.00.0100.00318.79
8.1.340.0110.00917.79
8.1.330.0100.00822.05
8.1.320.0110.00817.79
8.1.310.0080.00016.85
8.1.300.0140.00318.03
8.1.180.0040.00418.10
8.1.170.0160.00018.10
8.1.160.0040.01318.10
8.1.150.0160.00018.10
8.1.140.0090.00617.78
8.1.130.0090.00417.80
8.1.120.0120.00417.82
8.1.110.0080.00417.46
8.1.100.0080.00617.45
8.1.90.0100.00617.48
8.1.80.0100.00617.44
8.1.70.0100.00617.43
8.1.60.0120.00517.56
8.1.50.0130.00517.52
8.1.40.0120.00617.54
8.1.30.0130.00517.64
8.1.20.0120.00517.62
8.1.10.0130.00517.55
8.1.00.0120.00517.50
8.0.280.0080.00818.10
8.0.270.0070.00917.45
8.0.260.0050.01117.42
8.0.250.0120.00517.40
8.0.240.0100.00416.93
8.0.230.0110.00416.90
8.0.220.0090.00616.89
8.0.210.0110.00316.90
8.0.200.0100.00516.94
8.0.190.0100.00516.92
8.0.180.0110.00516.91
8.0.170.0100.00516.90
8.0.160.0100.00516.87
8.0.150.0080.00716.85
8.0.140.0120.00316.86
8.0.130.0110.00416.87
8.0.120.0090.00616.90
8.0.110.0100.00516.88
8.0.100.0100.00516.87
8.0.90.0070.00716.86
8.0.80.0110.00416.89
8.0.70.0090.00616.85
8.0.60.0090.00516.84
8.0.50.0110.00316.86
8.0.30.0100.00416.85
8.0.20.0100.00516.93
8.0.10.0080.00616.95
7.4.330.0070.00717.20
7.4.320.0080.00516.43
7.4.300.0110.00416.47
7.4.290.0110.00416.43
7.4.280.0090.00516.44
7.4.270.0100.00516.44
7.4.260.0080.00616.41
7.4.250.0090.00516.41
7.4.240.0100.00416.45
7.4.230.0100.00516.42
7.4.220.0090.00416.45
7.4.210.0090.00516.39
7.4.200.0090.00516.45
7.4.190.0080.00516.49
7.4.180.0090.00416.48
7.4.160.0080.00516.43
7.4.150.0080.00516.37
7.4.140.0080.00416.36
7.4.130.0080.00416.31
7.4.120.0080.00516.28
7.4.110.0070.00516.24
7.4.100.0070.00416.36
7.4.90.0070.00416.28
7.4.80.0070.00416.24
7.4.70.0070.00416.27
7.4.60.0050.00616.26
7.4.50.0070.00516.26
7.4.40.0080.00416.24
7.4.30.0060.00516.27
7.4.20.0070.00516.28
7.4.10.0060.00516.26
7.4.00.0060.00416.25

preferences:
32.48 ms | 403 KiB | 5 Q