3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testOptional(string $hello, string|null $world = null) { return $hello . ' ' . ($world ?? 'world'); } function testNullable(string $hello, string|null $world) { return $hello . ' ' . ($world ?? 'world'); } echo testOptional('hello'), PHP_EOL; echo testNullable('hello'), PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
hello world Fatal error: Uncaught ArgumentCountError: Too few arguments to function testNullable(), 1 passed in /in/gXLDH on line 14 and exactly 2 expected in /in/gXLDH:8 Stack trace: #0 /in/gXLDH(14): testNullable('hello') #1 {main} thrown in /in/gXLDH on line 8
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:
81.76 ms | 406 KiB | 5 Q