3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a; public function getA() { return $this->a; } public function setA($a) { $this->a = $a; } } $b = 'b'; $a = new A(); $a->setA("coucou"); echo $a->getA(); modifyA($b); echo $a->getA(); function modifyA(A $a) { $a->setA('B'); }
Output for git.master, git.master_jit, rfc.property-hooks
coucou Fatal error: Uncaught TypeError: modifyA(): Argument #1 ($a) must be of type A, string given, called in /in/hLkKQ on line 22 and defined in /in/hLkKQ:29 Stack trace: #0 /in/hLkKQ(22): modifyA('b') #1 {main} thrown in /in/hLkKQ on line 29
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:
56.22 ms | 401 KiB | 8 Q