3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ColorChanger { public $lastColor; public function blackMethod() { echo "blackMethod(); Last color: {$this->lastColor}\n"; $this->lastColor = 'black'; return $this; } public function whiteMethod() { echo "whiteMethod(); Last color: {$this->lastColor}\n"; $this->lastColor = 'white'; return $this; } public function colourMethod() { echo "colourMethod(): {$this->lastColor}\n"; $this->lastColor = null; } } $c = new ColorChanger(); $c->blackMethod()->colourMethod(); $c->whiteMethod()->colourMethod(); $c->blackMethod()->whiteMethod()->colourMethod();
Output for git.master_jit, git.master, rfc.property-hooks
blackMethod(); Last color: colourMethod(): black whiteMethod(); Last color: colourMethod(): white blackMethod(); Last color: whiteMethod(); Last color: black colourMethod(): white

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:
147.05 ms | 405 KiB | 5 Q