3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(string $a = null) {} const A = null; function bar(string $a = A) {} foo(); // Deprecated bar(); // Fatal error ?>
Output for git.master, git.master_jit
Deprecated: foo(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead in /in/g846c on line 3 Fatal error: Uncaught TypeError: bar(): Argument #1 ($a) must be of type string, null given, called in /in/g846c on line 10 and defined in /in/g846c:7 Stack trace: #0 /in/g846c(10): bar() #1 {main} thrown in /in/g846c on line 7
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:
39.52 ms | 869 KiB | 4 Q