3v4l.org

run code in 500+ PHP versions simultaneously
<?php class User {} function handle(User ...$userList) { print count($userList)." users\n"; /** ... */ } $bunchOfUsers = [ new User(), new User(), ]; echo handle(...$bunchOfUsers); $bunchOfUsers[] = 1; echo handle(...$bunchOfUsers); // error!$bunchOfUsers
Output for git.master, git.master_jit
2 users Fatal error: Uncaught TypeError: handle(): Argument #3 must be of type User, int given, called in /in/Ov9mJ on line 18 and defined in /in/Ov9mJ:5 Stack trace: #0 /in/Ov9mJ(18): handle(Object(User), Object(User), 1) #1 {main} thrown in /in/Ov9mJ on line 5
Process exited with code 255.

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:
49.7 ms | 877 KiB | 4 Q