3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { private object $secret; public object $container { get { $obj = new stdClass(); $obj->test = random_bytes(7); return $obj; } set (object $val){ $this->secret = $val; } } public function getSecret() { return $this->secret; } } $a = new A(); var_dump($a->container); var_dump($a->container); $a->container = new stdClass(); var_dump($a->container); var_dump($a->getSecret());
Output for git.master_jit
object(stdClass)#2 (1) { ["test"]=> string(7) "6��o;" } object(stdClass)#2 (1) { ["test"]=> string(7) "�mp�[" } object(stdClass)#3 (1) { ["test"]=> string(7) "Ӱ5(��_" } object(stdClass)#2 (0) { }
Output for git.master

Process exited with code 139.

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:
57.29 ms | 493 KiB | 3 Q