3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar(string $label): void { echo "Callable called: $label\n"; } } class MyClass { private static string $myCallable; public function myFunc(): void { static::$myCallable = \Foo::class . '::bar'; (self::$myCallable)('this also works'); } } $myCallable = \Foo::class . '::bar'; $myCallable('calling this works!'); (new MyClass)->myFunc();

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.0120.00822.21
8.4.110.0080.01222.54
8.4.100.0110.00917.61
8.4.90.0050.00518.57
8.4.80.0130.00517.66
8.4.70.0070.00417.89
8.4.60.0110.01018.69
8.4.50.0110.01019.34
8.4.40.0370.01017.27
8.4.30.0380.00817.34
8.4.20.0340.00317.48
8.4.10.0200.00417.41
8.3.250.0100.00818.81
8.3.240.0110.00816.50
8.3.230.0090.01016.56
8.3.220.0040.00417.20
8.3.210.0110.01316.48
8.3.200.0070.00216.51
8.3.190.0100.00916.84
8.3.180.0150.00318.87
8.3.170.0250.00516.25
8.3.160.0320.00816.41
8.3.150.0380.00516.52
8.3.140.0340.01116.38
8.3.130.0550.00916.49
8.3.120.0340.00316.52
8.3.110.0190.00716.79
8.3.100.0310.00516.39
8.3.90.0300.00816.30
8.3.80.0380.01016.23
8.3.70.0380.00816.76
8.3.60.0390.00716.22
8.3.50.0370.00816.34
8.3.40.0310.00617.39
8.3.30.0280.00917.51
8.3.20.0380.00317.61
8.3.10.0320.00617.50
8.3.00.0160.01017.34
8.2.290.0060.00420.41
8.2.280.0040.00516.84
8.2.270.0350.00516.14
8.2.260.0250.01016.19
8.2.250.0190.00416.44
8.2.240.0140.00616.09
8.2.230.0150.00216.46
8.2.220.0320.00816.57
8.2.210.0300.00916.66
8.2.200.0290.00916.24
8.2.190.0330.00616.49
8.2.180.0320.00716.40
8.2.170.0340.00717.54
8.2.160.0340.00717.54
8.2.150.0340.00917.34
8.2.140.0380.00517.29
8.2.130.0360.01017.14
8.2.120.0350.00917.53
8.2.110.0360.00617.44
8.2.100.0320.00817.50
8.2.90.0300.01217.49
8.2.80.0380.00517.57
8.2.70.0340.00417.45
8.2.60.0350.01217.27
8.2.50.0320.00617.50
8.2.40.0280.00917.46
8.2.30.0230.01117.57
8.2.20.0330.00717.45
8.2.10.0280.00917.50
8.2.00.0370.00517.41
8.1.320.0080.01116.09

preferences:
38.52 ms | 403 KiB | 5 Q