3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(int $x, int $a, int $b = 2) { var_dump($x, $a, $b); } $rf = new ReflectionFunction("foo"); $rf->invokeArgs([1 => 0, 0 => 1, "b" => 6]); class Foo { public function __construct(int $x, int $a, int $b = 2) { var_dump($x, $a, $b); } public function method(int $x, int $a, int $b = 2) { var_dump($x, $a, $b); } } $rc = new ReflectionClass(Foo::class); $instance = $rc->newInstanceArgs([1 => 0, 0 => 1, "b" => 6]); $rc->getMethod("method")->invokeArgs($instance, [1 => 0, 0 => 1, "b" => 6]);

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.3.120.0090.00018.93
8.3.110.0040.00720.94
8.3.100.0030.00616.48
8.3.90.0040.00426.77
8.3.80.0030.00618.18
8.3.70.0150.00818.32
8.3.60.0390.01825.92
8.3.50.0230.00625.92
8.3.40.0280.01625.92
8.3.30.0390.00825.92
8.3.20.0350.01325.92
8.3.10.0350.00825.92
8.3.00.0330.01525.92
8.2.240.0120.00617.29
8.2.230.0030.00622.58
8.2.220.0090.00024.06
8.2.210.0100.00026.77
8.2.200.0060.00316.63
8.2.190.0120.00916.58
8.2.180.0360.01125.92
8.2.170.0430.00625.92
8.2.160.0400.01025.92
8.2.150.0440.00325.92
8.2.140.0370.00825.92
8.2.130.0420.01025.92
8.2.120.0390.00925.92
8.2.110.0440.00825.92
8.2.100.0310.00925.92
8.2.90.0270.01425.92
8.2.80.0270.01325.92
8.2.70.0330.00725.92
8.2.60.0320.00725.92
8.2.50.0350.00425.92
8.2.40.0230.01525.92
8.2.30.0300.00725.92
8.2.20.0340.01025.92
8.2.10.0360.00725.92
8.2.00.0300.01725.92
8.1.300.0090.00015.89
8.1.290.0060.00330.84
8.1.280.0320.01125.92
8.1.270.0500.00025.92
8.1.260.0560.01425.92
8.1.250.0520.00325.92
8.1.240.0350.01025.92
8.1.230.0360.00925.92
8.1.220.0340.00725.92
8.1.210.0220.00925.92
8.1.200.0230.00825.92
8.1.190.0170.01325.92
8.1.180.0300.00025.92
8.1.170.0260.00425.92
8.1.160.0190.01125.92
8.1.150.0220.00725.92
8.1.140.0210.00825.92
8.1.130.0220.00825.92
8.1.120.0210.00925.92
8.1.110.0230.00825.92
8.1.100.0260.00325.92
8.1.90.0290.00325.92
8.1.80.0210.00925.92
8.1.70.0310.00325.92
8.1.60.0390.00425.92
8.1.50.0310.01725.92
8.1.40.0360.01125.92
8.1.30.0430.00325.92
8.1.20.0390.00825.92
8.1.10.0350.01225.92
8.1.00.0400.00725.92
7.4.330.0100.00316.19

preferences:
29.68 ms | 403 KiB | 5 Q