3v4l.org

run code in 500+ PHP versions simultaneously
<?php class User { public function register($email, $password, $active = null, $default = 0, ...$attributes) { $argv = debug_backtrace(0, 1)[0]['args'] ?? []; $argc = count($argv); print_r([ '$argc' => $argc, '$argv' => $argv, ]); 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' ]);
Output for git.master, git.master_jit
Array ( [$argc] => 5 [$argv] => Array ( [0] => admin@test.com [1] => pass1 [id] => uuid-1 [phone] => 012-345-6789 [role] => admin ) ) -------- Array ( [$argc] => 6 [$argv] => Array ( [0] => test@test.com [1] => pass2 [id] => uuid-2 [phone] => 987-654-3210 [name] => first last2 [role] => tester ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.67 ms | 2868 KiB | 4 Q