3v4l.org

run code in 500+ PHP versions simultaneously
<?php function ghost_func_num_args(string $class, string $method, array $vars = []) { return count(ghost_func_get_args($class, $method, $vars)); } function ghost_func_get_args(string $class, string $method, array $vars = []) { $argc = 0; $argv = []; $reflectionMethod = new ReflectionMethod($class, $method); foreach ($reflectionMethod->getParameters() as $parameter) { $name = $parameter->getName(); $values = $vars[$name] ?? null; if (! $parameter->isVariadic()) { $argv[$parameter->getPosition()] = $values; ++$argc; continue; } foreach ($values as $value) { $argv[$argc++] = $value; } } return $argv; } function ghost_func_get_named_args(string $class, string $method, array $vars = []) { $argv_named = []; $reflectionMethod = new ReflectionMethod($class, $method); foreach ($reflectionMethod->getParameters() as $parameter) { $name = $parameter->getName(); $values = $vars[$name] ?? null; if (! $parameter->isVariadic()) { $argv_named[$name] = $values; continue; } foreach ($values as $key => $value) { $argv_named[$key] = $value; } } return $argv_named; } class User { public function register($email, $password, $active = null, $default = 0, ...$attributes) { $__mockery__vars = get_defined_vars(); $argc = ghost_func_num_args(__CLASS__, __FUNCTION__, $__mockery__vars); $argv = ghost_func_get_args(__CLASS__, __FUNCTION__, $__mockery__vars); $argv_named = ghost_func_get_named_args(__CLASS__, __FUNCTION__, $__mockery__vars); print_r([ '$argc' => $argc, '$argv' => $argv, '$argv_named' => $argv_named, ]); return [$email, $password, $attributes]; } } $foo = new User(); $foo->register('admin@test.com', 'pass1', ...[ 'id' => 'uuid-1', 'phone' => '012-345-6789', 'role' => 'admin', ]); echo PHP_EOL . '--------' . PHP_EOL; $foo->register(...[ 'id' => 'uuid-2', 'email' => 'test@test.com', 'phone' => '987-654-3210', 'name' => 'first last2', 'role' => 'tester', 'password' => 'pass2' ]);

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.100.0110.00616.74
8.5.90.0070.00417.21
8.5.80.0120.00617.02
8.5.70.0080.00416.83
8.5.60.0120.00916.97
8.5.50.0120.00716.62
8.5.40.0090.00416.54
8.5.30.0090.00416.71
8.5.20.0130.00716.83
8.5.10.0130.00616.74
8.5.00.0080.00216.92
8.4.250.0150.00919.48
8.4.240.0110.01019.56
8.4.230.0170.00719.73
8.4.220.0070.00619.61
8.4.210.0110.00219.72
8.4.200.0130.01119.61
8.4.190.0080.00619.59
8.4.180.0130.00519.79
8.4.170.0130.00819.72
8.4.160.0080.00519.86
8.4.150.0130.00619.84
8.4.140.0090.00417.74
8.4.130.0040.00719.45
8.4.120.0130.00919.44
8.4.110.0110.00919.50
8.4.100.0110.00717.70
8.4.90.0100.00217.82
8.4.80.0070.00617.88
8.4.70.0080.00317.82
8.4.60.0080.00517.98
8.4.50.0170.00817.89
8.4.40.0140.00217.86
8.4.30.0130.01017.75
8.4.20.0140.00917.71
8.4.10.0150.00617.67
8.3.330.0110.00518.70
8.3.320.0070.00518.68
8.3.310.0120.01318.64
8.3.300.0100.01118.48
8.3.290.0040.00718.59
8.3.280.0070.00418.63
8.3.270.0020.00816.94
8.3.260.0050.00416.80
8.3.250.0140.00716.91
8.3.240.0130.00616.54
8.3.230.0130.00616.46
8.3.220.0140.00716.70
8.3.210.0140.00916.69
8.3.200.0120.01016.66
8.3.190.0140.00916.59
8.3.180.0170.00416.91
8.3.170.0170.00916.80
8.3.160.0160.00416.75
8.3.150.0130.00716.92
8.3.140.0160.00716.57
8.3.130.0130.01116.73
8.3.120.0100.00916.92
8.3.110.0130.00616.89
8.3.100.0160.00916.81
8.3.90.0110.00516.93
8.3.80.0070.00516.60
8.3.70.0080.00516.70
8.3.60.0090.00516.78
8.3.50.0060.00916.88
8.3.40.0080.00518.09
8.3.30.0070.00518.10
8.3.20.0110.00618.04
8.3.10.0130.00318.01
8.3.00.0080.00718.05
8.2.330.0160.01118.11
8.2.320.0100.00818.15
8.2.310.0080.00518.19
8.2.300.0160.00417.98
8.2.290.0210.00816.36
8.2.280.0260.00616.59
8.2.270.0320.00616.55
8.2.260.0260.00916.44
8.2.250.0280.01016.37
8.2.240.0250.00916.60
8.2.230.0320.00616.44
8.2.220.0240.00716.61
8.2.210.0190.00516.43
8.2.200.0120.00916.73
8.2.190.0200.00616.55
8.2.180.0190.00616.46
8.2.170.0290.00817.80
8.2.160.0240.01118.25
8.2.150.0150.00317.93
8.2.140.0240.01517.86
8.2.130.0220.00717.97
8.2.120.0250.01117.92
8.2.110.0220.00618.02
8.2.100.0240.01018.02
8.2.90.0290.00617.97
8.2.80.0290.00717.91
8.2.70.0280.00717.97
8.2.60.0200.00317.88
8.2.50.0250.00817.96
8.2.40.0180.00718.15
8.2.30.0270.00617.80
8.2.20.0280.00618.17
8.2.10.0250.00918.09
8.2.00.0250.01017.96
8.1.340.0210.00817.58
8.1.330.0110.00516.38
8.1.320.0160.01016.21
8.1.310.0140.00516.25
8.1.300.0130.00616.23
8.1.290.0160.00215.90
8.1.280.0170.00416.21
8.1.270.0200.00617.91
8.1.260.0150.00317.95
8.1.250.0300.00417.97
8.1.240.0150.00917.91
8.1.230.0210.00117.98
8.1.220.0180.00717.85
8.1.210.0310.00717.50
8.1.200.0280.00917.79
8.1.190.0270.00917.70
8.1.180.0290.00717.76
8.1.170.0210.01017.77
8.1.160.0190.00817.68
8.1.150.0220.00417.73
8.1.140.0280.00717.83
8.1.130.0280.00817.80
8.1.120.0200.00817.70
8.1.110.0310.00717.58
8.1.100.0230.00517.87
8.1.90.0130.00417.88
8.1.80.0130.00617.87
8.1.70.0120.00517.86
8.1.60.0310.00617.71
8.1.50.0300.00817.80
8.1.40.0090.00618.00
8.1.30.0220.00518.09
8.1.20.0270.00617.98
8.1.10.0210.00517.88
8.1.00.0230.00717.95
8.0.300.0080.00417.09
8.0.290.0200.00817.11
8.0.280.0110.00617.11
8.0.270.0290.00517.09
8.0.260.0230.01116.99
8.0.250.0320.00816.83
8.0.240.0130.00516.87
8.0.230.0290.00117.07
8.0.220.0120.00516.98
8.0.210.0160.00316.98
8.0.200.0230.00716.89
8.0.190.0210.00517.05
8.0.180.0250.01017.02
8.0.170.0260.00517.10
8.0.160.0250.00617.05
8.0.150.0230.00716.86
8.0.140.0230.00616.83
8.0.130.0160.00616.86
8.0.120.0170.00816.99
8.0.110.0150.00417.21
8.0.100.0260.00616.88
8.0.90.0200.00716.95
8.0.80.0180.00616.90
8.0.70.0260.00916.86
8.0.60.0290.00416.91
8.0.50.0230.00516.98
8.0.30.0150.00917.08
8.0.20.0270.00817.02
8.0.10.0240.00517.00
8.0.00.0230.00617.23
7.4.330.0060.00416.83
7.4.320.0270.00416.71
7.4.300.0190.00416.61
7.4.290.0300.00116.84
7.4.280.0200.00316.81
7.4.270.0240.00316.46
7.4.260.0270.00516.60
7.4.250.0200.00316.62
7.4.240.0170.00816.46
7.4.230.0210.00316.78
7.4.220.0140.00716.61
7.4.210.0160.00616.84
7.4.200.0150.00616.84
7.4.190.0240.00716.86
7.4.180.0200.00716.82
7.4.160.0220.00516.87
7.4.150.0190.00316.78
7.4.140.0240.00916.48
7.4.130.0230.00816.39
7.4.120.0250.00516.60
7.4.110.0200.00416.78
7.4.100.0280.00716.79
7.4.90.0270.00816.55
7.4.80.0260.00816.59
7.4.70.0270.00216.71
7.4.60.0280.00816.63
7.4.50.0240.00616.70
7.4.40.0120.00616.66
7.4.30.0220.00916.54
7.4.20.0250.00616.71
7.4.10.0130.00616.68
7.4.00.0150.00216.52
7.3.330.0120.00216.55
7.3.320.0250.00916.43
7.3.310.0200.00416.36
7.3.300.0170.00516.68
7.3.290.0160.00516.62
7.3.280.0280.00516.61
7.3.270.0200.00516.50
7.3.260.0240.00816.63
7.3.250.0260.00316.68
7.3.240.0160.00516.60
7.3.230.0110.00516.68
7.3.220.0120.00416.67
7.3.210.0230.00516.64
7.3.200.0150.00516.52
7.3.190.0240.00716.61
7.3.180.0250.00616.61
7.3.170.0140.00216.61
7.3.160.0130.00316.60
7.3.150.0230.00716.62
7.3.140.0150.00716.45
7.3.130.0200.00816.57
7.3.120.0260.00616.52
7.3.110.0150.00516.61
7.3.100.0290.00616.44
7.3.90.0250.00816.55
7.3.80.0250.00516.68
7.3.70.0280.00516.52
7.3.60.0240.00216.72
7.3.50.0130.00416.77
7.3.40.0130.00716.71
7.3.30.0190.00416.58
7.3.20.0160.00718.21
7.3.10.0280.00518.01
7.3.00.0140.00318.29
7.2.340.0200.00316.62
7.2.330.0250.00916.54
7.2.320.0210.00716.57
7.2.310.0310.01116.30
7.2.300.0210.00716.30
7.2.290.0170.00316.50
7.2.280.0160.00416.49
7.2.270.0180.00616.48
7.2.260.0170.00316.20
7.2.250.0210.00716.30
7.2.240.0130.00216.49
7.2.230.0160.00515.98
7.2.220.0150.00516.39
7.2.210.0220.00116.43
7.2.200.0120.00316.57
7.2.190.0170.00416.49
7.2.180.0120.00416.65
7.2.170.0140.00316.55
7.2.160.0130.00416.67
7.2.150.0140.00218.26
7.2.140.0130.00418.46
7.2.130.0180.00518.64
7.2.120.0120.00618.41
7.2.110.0170.00518.52
7.2.100.0150.00318.46
7.2.90.0110.00518.38
7.2.80.0170.00518.52
7.2.70.0190.00318.53
7.2.60.0160.00418.30
7.2.50.0170.00518.36
7.2.40.0200.00318.31
7.2.30.0160.00218.59
7.2.20.0170.00518.50
7.2.10.0190.00618.46
7.2.00.0170.00418.55
7.1.330.0120.00417.21
7.1.320.0120.00217.32
7.1.310.0120.00317.52
7.1.300.0130.00317.34
7.1.290.0170.00717.22
7.1.280.0190.00817.34
7.1.270.0120.00417.37
7.1.260.0160.00217.43
7.1.250.0130.00317.45
7.1.240.0110.00317.45
7.1.230.0130.00417.39
7.1.220.0110.00417.46
7.1.210.0110.00317.32
7.1.200.0130.00317.16
7.1.190.0120.00317.30
7.1.180.0090.00517.38
7.1.170.0130.00317.25
7.1.160.0120.00417.34
7.1.150.0110.00417.40
7.1.140.0110.00317.14
7.1.130.0230.00117.28
7.1.120.0190.00317.39
7.1.110.0170.00617.19
7.1.100.0110.00417.16
7.1.90.0130.00217.28
7.1.80.0130.00417.30
7.1.70.0130.00317.31
7.1.60.0140.00617.40
7.1.50.0240.00717.30
7.1.40.0190.00417.44
7.1.30.0150.00617.25
7.1.20.0270.00617.18
7.1.10.0140.00517.41
7.1.00.0090.00617.29
7.0.330.0090.01217.05
7.0.320.0140.00816.97
7.0.310.0240.00816.89
7.0.300.0190.00317.16
7.0.290.0120.00917.17
7.0.280.0250.00316.94
7.0.270.0190.00917.02
7.0.260.0220.00617.12
7.0.250.0280.00617.30
7.0.240.0250.00417.13
7.0.230.0240.00317.39
7.0.220.0100.00517.39
7.0.210.0130.00117.34
7.0.200.0170.00717.00
7.0.190.0110.01017.09
7.0.180.0180.00417.37
7.0.170.0210.00717.31
7.0.160.0190.00217.02
7.0.150.0170.00317.06
7.0.140.0150.00317.08
7.0.130.0180.00817.22
7.0.120.0240.00716.70
7.0.110.0170.00417.14
7.0.100.0190.00617.29
7.0.90.0210.00916.93
7.0.80.0210.00617.19
7.0.70.0140.00416.82
7.0.60.0190.00717.08
7.0.50.0230.00816.90
7.0.40.0190.00617.15
7.0.30.0180.00517.11
7.0.20.0150.00117.18
7.0.10.0220.00717.18
7.0.00.0160.00717.05
5.6.400.0060.00615.99
5.6.390.0130.00215.90
5.6.380.0190.00815.89
5.6.370.0110.00415.91
5.6.360.0120.00215.98
5.6.350.0240.00416.05
5.6.340.0250.00315.73
5.6.330.0230.00315.91
5.6.320.0210.00415.79
5.6.310.0230.00815.93
5.6.300.0140.00115.89
5.6.290.0120.00715.70
5.6.280.0210.00115.72
5.6.270.0260.00415.88
5.6.260.0110.00515.73
5.6.250.0180.00515.70
5.6.240.0190.00216.04
5.6.230.0220.01016.04
5.6.220.0210.00615.93
5.6.210.0200.00715.87
5.6.200.0160.00615.97
5.6.190.0190.00915.77
5.6.180.0150.00515.98
5.6.170.0100.00515.73
5.6.160.0160.00615.96
5.6.150.0160.00615.91
5.6.140.0140.00315.93
5.6.130.0210.00915.98
5.6.120.0270.00715.84
5.6.110.0100.00515.85
5.6.100.0240.00515.89
5.6.90.0110.00415.89
5.6.80.0230.00415.82
5.6.70.0210.00616.20
5.6.60.0110.00315.95
5.6.50.0130.00515.90
5.6.40.0210.00715.93
5.6.30.0220.00415.95
5.6.20.0120.00315.76
5.6.10.0120.01015.70
5.6.00.0250.00115.70
5.5.380.0120.00516.03
5.5.370.0240.00615.77
5.5.360.0090.00515.90
5.5.350.0260.00415.70
5.5.340.0230.00515.90
5.5.330.0190.01015.70
5.5.320.0230.00415.70
5.5.310.0230.00815.91
5.5.300.0130.00415.78
5.5.290.0250.00515.74
5.5.280.0130.00215.84
5.5.270.0100.00415.70
5.5.260.0190.00815.74
5.5.250.0210.00915.73
5.5.240.0170.00516.03
5.5.230.0150.00715.70
5.5.220.0230.00715.72
5.5.210.0220.00715.93
5.5.200.0210.00615.81
5.5.190.0220.00615.70
5.5.180.0180.00715.70
5.5.170.0240.00915.70
5.5.160.0180.00215.80
5.5.150.0170.00315.70
5.5.140.0200.00915.70
5.5.130.0210.00815.70
5.5.120.0230.00515.70
5.5.110.0170.00315.78
5.5.100.0110.00415.70
5.5.90.0120.00415.89
5.5.80.0130.00715.88
5.5.70.0220.00515.70
5.5.60.0150.00715.96
5.5.50.0160.00915.70
5.5.40.0190.00215.93
5.5.30.0190.00115.70
5.5.20.0170.00915.70
5.5.10.0230.00515.71
5.5.00.0190.01015.72
5.4.450.0100.00615.70
5.4.440.0160.00415.70
5.4.430.0100.00515.70
5.4.420.0190.00515.70
5.4.410.0110.00615.70
5.4.400.0190.00315.70
5.4.390.0150.00415.70
5.4.380.0140.00515.70
5.4.370.0110.00615.70
5.4.360.0170.00515.70
5.4.350.0090.00215.70
5.4.340.0200.00315.70
5.4.330.0170.00415.70
5.4.320.0220.00315.70
5.4.310.0220.00215.70
5.4.300.0150.00515.70
5.4.290.0100.00515.70
5.4.280.0140.00415.70
5.4.270.0090.00515.70
5.4.260.0100.00415.70
5.4.250.0080.00415.70
5.4.240.0090.00315.70
5.4.230.0090.00315.70
5.4.220.0150.00615.70
5.4.210.0170.00215.70
5.4.200.0150.00515.70
5.4.190.0150.00015.70
5.4.180.0130.00615.70
5.4.170.0170.00715.70
5.4.160.0120.00615.70
5.4.150.0150.00515.70
5.4.140.0110.00615.70
5.4.130.0090.00315.70
5.4.120.0110.00315.70
5.4.110.0180.00415.70
5.4.100.0150.00315.70
5.4.90.0170.00315.70
5.4.80.0120.00215.70
5.4.70.0090.00215.70
5.4.60.0180.00415.70
5.4.50.0080.00315.70
5.4.40.0210.00415.70
5.4.30.0160.00515.70
5.4.20.0170.00615.70
5.4.10.0100.00115.70
5.4.00.0160.00215.70
5.3.290.0020.00415.70
5.3.280.0080.00315.70
5.3.270.0170.00515.70
5.3.260.0190.00415.70
5.3.250.0170.00715.70
5.3.240.0190.00215.70
5.3.230.0150.00615.70
5.3.220.0180.00515.70
5.3.210.0190.00515.70
5.3.200.0130.00515.70
5.3.190.0100.00415.70
5.3.180.0170.00415.70
5.3.170.0160.00615.70
5.3.160.0180.00415.70
5.3.150.0100.00415.70
5.3.140.0190.00615.70
5.3.130.0110.00515.70
5.3.120.0200.00315.70
5.3.110.0180.00415.70
5.3.100.0190.00315.70
5.3.90.0160.00815.70
5.3.80.0160.00515.70
5.3.70.0120.00215.70
5.3.60.0090.00215.70
5.3.50.0090.00215.70
5.3.40.0150.00315.70
5.3.30.0120.00315.70
5.3.20.0130.00815.70
5.3.10.0150.00715.70
5.3.00.0080.00415.70
5.2.170.0080.00515.70
5.2.160.0160.00115.70
5.2.150.0120.00415.70
5.2.140.0140.00515.70
5.2.130.0120.00315.70
5.2.120.0090.00315.70
5.2.110.0060.00315.70
5.2.100.0130.00315.70
5.2.90.0150.00515.70
5.2.80.0130.00515.70
5.2.70.0120.00415.70
5.2.60.0150.00315.70
5.2.50.0100.00515.70
5.2.40.0150.00515.70
5.2.30.0140.00215.70
5.2.20.0140.00615.70
5.2.10.0090.00315.70
5.2.00.0060.00215.70
5.1.60.0060.00315.70
5.1.50.0050.00315.70
5.1.40.0060.00115.70
5.1.30.0130.00415.70
5.1.20.0120.00415.70
5.1.10.0110.00515.70
5.1.00.0100.00515.70
5.0.50.0090.00315.70
5.0.40.0030.00415.70
5.0.30.0080.00315.70
5.0.20.0060.00015.70
5.0.10.0040.00215.70
5.0.00.0060.00715.70
4.4.90.0080.00215.70
4.4.80.0060.00315.70
4.4.70.0060.00315.70
4.4.60.0080.00115.70
4.4.50.0070.00315.70
4.4.40.0060.00315.70
4.4.30.0050.00415.70
4.4.20.0060.00215.70
4.4.10.0060.00215.70
4.4.00.0080.00115.70
4.3.110.0070.00215.70
4.3.100.0060.00215.70
4.3.90.0090.00015.70
4.3.80.0070.00215.70
4.3.70.0060.00215.70
4.3.60.0080.00115.70
4.3.50.0060.00315.70
4.3.40.0080.00115.70
4.3.30.0030.00315.70
4.3.20.0030.00115.70
4.3.10.0050.00215.70
4.3.00.0060.00215.70

preferences:
56.67 ms | 2990 KiB | 5 Q