3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $test; public function __construct($test = 1) { $this->test = $test; } protected function increaseTest() { $this->test++; } public function getTest() { return $this->test; } } class TestChild extends Test { public function increase() { $this->increaseTest(); } } $test = new TestChild(); echo $test->getTest() . "\n"; $test->increase(); echo $test->getTest() . "\n"; $test2 = new TestChild(5); echo $test2->getTest() . "\n"; $test2->increase(); echo $test2->getTest() . "\n";
Output for git.master, git.master_jit, rfc.property-hooks
1 2 5 6

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:
58.15 ms | 401 KiB | 8 Q