3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Movie { private $one = ''; private $two = ''; private $three = ''; public function one(): self { $this->one = "One "; return $this; // return object } public function two(): self { $this->two = "Flew Over the "; return $this; // return object } public function three(): self { $this->three = "Cuckoo's Nest"; return $this; // return object } public function show(): string { return $this->one . $this->two . $this->three; } } $movie = new Movie(); echo $movie->one()->two()->three()->show();
Output for rfc.property-hooks, git.master, git.master_jit
One Flew Over the Cuckoo's Nest

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.15 ms | 1340 KiB | 5 Q