3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public string $a; public string $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } } // test only a $c = new C("foo", null); var_dump($c->a === "foo"); // test only b $c = new C(null, "foo"); var_dump($c->b === "foo"); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Cannot assign null to property C::$b of type string in /in/EKk50:7 Stack trace: #0 /in/EKk50(12): C->__construct('foo', NULL) #1 {main} thrown in /in/EKk50 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:
34.96 ms | 401 KiB | 8 Q