3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $data; protected $foo = ''; public function a() { (new B())->foo($this); var_dump($this); if (isset($this->data['test'])) { $this->foo = $this->data['test']; } } } class B { public function foo(&$var) { $var = 1; } } $a = new A(); $a->a();
Output for git.master_jit, git.master, rfc.property-hooks
object(A)#1 (2) { ["data":protected]=> NULL ["foo":protected]=> string(0) "" }

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