3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Updating var1 would update var2 as well. $var1 = $var2 = Url::create(); $var1->setQuery(); var_dump($var2); // Clone shouldn't be an issue. $var3 = Url::create(); $var4 = clone $var3; $var3->setQuery(); var_dump($var4); class Url { protected $query = FALSE; public static function create() { return new static(); } public function setQuery() { $this->query = TRUE; return $this; } }
Output for git.master, git.master_jit, rfc.property-hooks
object(Url)#1 (1) { ["query":protected]=> bool(true) } object(Url)#3 (1) { ["query":protected]=> bool(false) }

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