3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo(string $text = null) { var_dump($text); } } class B extends A { public function foo(?string $text = null) { var_dump($text); } } $a = new A(); $a->foo('Hello'); $b = new B(); $b->foo('Hello');
Output for git.master, git.master_jit
Deprecated: A::foo(): Implicitly marking parameter $text as nullable is deprecated, the explicit nullable type must be used instead in /in/0g8Ch on line 5 string(5) "Hello" string(5) "Hello"
Output for rfc.property-hooks
string(5) "Hello" string(5) "Hello"

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:
33.66 ms | 478 KiB | 5 Q