3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { protected Closure $modifier; public function __construct(callable $modifier) { $this->modifier = Closure::fromCallable($modifier); } public function runClosure() { var_dump(($this->modifier)()); } } class SomeOtherClass { public static function func() { return ['a' => 'b']; } } $test = new MyClass(SomeOtherClass::func(...)); $test->runClosure();

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.0040.00520.90
8.4.110.0080.00422.62
8.4.100.0140.00717.65
8.4.90.0110.00920.63
8.4.80.0040.00418.98
8.4.70.0060.00319.07
8.4.60.0090.01020.76
8.4.50.0110.00520.52
8.4.40.0100.00717.73
8.4.30.0030.00620.59
8.4.20.0100.01019.82
8.4.10.0040.00419.41
8.3.250.0110.00818.80
8.3.240.0060.00316.66
8.3.230.0050.00516.64
8.3.220.0050.00218.71
8.3.210.0090.00516.73
8.3.200.0030.00616.64
8.3.190.0110.00617.19
8.3.180.0070.00119.11
8.3.170.0090.00417.11
8.3.160.0140.00416.57
8.3.150.0040.00416.55
8.3.140.0030.00618.42
8.3.130.0040.00418.58
8.3.120.0030.00620.89
8.3.110.0150.00517.40
8.3.100.0160.00717.38
8.3.90.0110.00317.29
8.3.80.0090.00517.36
8.3.70.0150.00217.40
8.3.60.0100.00917.53
8.3.50.0100.00716.44
8.3.40.0110.00517.56
8.3.30.0070.00518.31
8.3.20.0100.00517.38
8.3.10.0080.00917.44
8.3.00.0070.00417.31
8.2.290.0060.00616.94
8.2.280.0110.00618.29
8.2.270.0000.01416.60
8.2.260.0070.00716.59
8.2.250.0000.00816.73
8.2.240.0060.01316.98
8.2.230.0060.00816.46
8.2.220.0060.00516.44
8.2.210.0120.00316.51
8.2.200.0080.00716.25
8.2.190.0130.00216.88
8.2.180.0100.00516.44
8.2.170.0110.00617.56
8.2.160.0110.00617.50
8.2.150.0110.00517.44
8.2.140.0130.00417.31
8.2.130.0140.00217.30
8.2.120.0140.00217.41
8.2.110.0120.00517.44
8.2.100.0130.00317.38
8.2.90.0120.00317.17
8.2.80.0110.00517.56
8.2.70.0050.00917.48
8.2.60.0020.00917.30
8.2.50.0080.00417.50
8.2.40.0050.00617.63
8.2.30.0070.00417.23
8.2.20.0060.00517.38
8.2.10.0030.00817.44
8.2.00.0110.00217.38
8.1.330.0110.00821.88
8.1.320.0120.00715.90
8.1.310.0100.00316.54
8.1.300.0040.00418.48
8.1.290.0080.00417.22
8.1.280.0080.00416.90
8.1.270.0060.00618.03
8.1.260.0040.00818.13
8.1.250.0090.00317.10
8.1.240.0070.00517.18
8.1.230.0100.00218.04
8.1.220.0100.00217.17
8.1.210.0090.00217.18
8.1.200.0080.00417.12
8.1.190.0050.00617.93
8.1.180.0090.00317.17
8.1.170.0040.00717.11
8.1.160.0070.00417.23
8.1.150.0070.00417.11
8.1.140.0060.00517.96
8.1.130.0070.00417.19
8.1.120.0060.00517.18
8.1.110.0100.00717.22
8.1.100.0080.00417.11
8.1.90.0110.00517.22
8.1.80.0110.00217.29
8.1.70.0060.00617.28
8.1.60.0100.00417.18
8.1.50.0100.00217.24
8.1.40.0090.00417.30
8.1.30.0060.00617.36
8.1.20.0090.00217.55
8.1.10.0090.00317.35
8.1.00.0060.00517.24

preferences:
27.02 ms | 403 KiB | 5 Q