3v4l.org

run code in 300+ PHP versions simultaneously
<?php class return_a{} class return_b{} class return_c{} /** * @method A(): return_a * @method B(): return_b * @method C(): return_c */ class Database { public function method_a($proc_name, $args): return_a { return new return_a($proc_name, $args); } public function method_b($proc_name, $args): return_b { return new return_b($proc_name, $args); } public function method_c($proc_name, $args): return_c { return new return_c($proc_name, $args); } public function __call($function, $args): return_a|return_b|return_c|null { return match ($function) { "A" => $this->method_a($function, $args), "B" => $this->method_b($function, $args), "C" => $this->method_c($function, $args), default => null, }; } } (new Database)->A();

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.0070.00420.31
8.4.110.0130.00718.57
8.4.100.0130.00817.79
8.4.90.0150.00617.64
8.4.80.0120.00817.82
8.4.70.0030.00617.85
8.4.60.0110.01018.62
8.4.50.0070.00923.08
8.4.40.0190.00017.94
8.4.30.0100.00718.86
8.4.20.0130.00719.56
8.4.10.0030.00619.33
8.3.250.0110.00618.60
8.3.240.0100.00916.70
8.3.230.0080.00316.54
8.3.220.0120.00716.61
8.3.210.0060.00216.41
8.3.200.0050.00316.63
8.3.190.0080.00919.21
8.3.180.0090.00716.56
8.3.170.0070.01118.96
8.3.160.0110.00716.45
8.3.150.0120.00617.14
8.3.140.0040.00416.63
8.3.130.0040.00418.52
8.3.120.0050.00520.56
8.3.110.0060.00320.94
8.3.100.0090.00016.75
8.3.90.0050.00316.47
8.3.80.0100.01030.84
8.3.70.0320.00830.84
8.3.60.0290.00430.84
8.3.50.0110.00030.84
8.3.40.0200.00030.84
8.3.30.0150.01030.84
8.3.20.0320.00630.84
8.3.10.0170.00730.84
8.3.00.0210.00530.84
8.2.290.0120.00720.32
8.2.280.0030.00518.41
8.2.270.0070.01116.83
8.2.260.0090.00916.60
8.2.250.0040.00418.94
8.2.240.0030.00617.05
8.2.230.0030.00622.58
8.2.220.0040.00424.06
8.2.210.0070.00026.77
8.2.200.0210.01030.84
8.2.190.0270.01230.84
8.2.180.0340.00830.84
8.2.170.0370.00730.84
8.2.160.0270.01230.84
8.2.150.0240.00430.84
8.2.140.0180.00630.84
8.2.130.0220.00930.84
8.2.120.0270.00030.84
8.2.110.0170.00630.84
8.2.100.0140.00730.84
8.2.90.0240.00330.84
8.2.80.0130.01330.84
8.2.70.0230.00030.84
8.2.60.0230.00030.84
8.2.50.0170.00830.84
8.2.40.0190.00330.84
8.2.30.0220.00230.84
8.2.20.0340.00730.84
8.2.10.0360.00330.84
8.2.00.0290.01030.84
8.1.330.0140.00416.93
8.1.320.0100.01116.11
8.1.310.0040.00416.39
8.1.300.0120.00015.93
8.1.290.0300.00330.84
8.1.280.0120.01530.84
8.1.270.0190.00630.84
8.1.260.0120.01230.84
8.1.250.0210.00430.84
8.1.240.0250.00030.84
8.1.230.0100.01430.84
8.1.220.0140.01130.84
8.1.210.0150.01030.84
8.1.200.0190.00630.84
8.1.190.0240.00330.84
8.1.180.0190.00730.84
8.1.170.0190.00830.84
8.1.160.0300.00430.84
8.1.150.0200.00930.84
8.1.140.0180.00530.84
8.1.130.0180.00430.84
8.1.120.0200.00530.84
8.1.110.0150.00730.84
8.1.100.0180.00330.84
8.1.90.0220.00330.84
8.1.80.0200.00030.84
8.1.70.0120.00930.84
8.1.60.0190.00330.84
8.1.50.0210.00630.84
8.1.40.0200.00730.84
8.1.30.0180.00730.84
8.1.20.0190.00830.84
8.1.10.0180.00930.84
8.1.00.0230.00430.84

preferences:
27.48 ms | 403 KiB | 5 Q