3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $prop; public function change() { $prop=2; } public function output() { echo $prop; } } class b { public function change() { $this->prop=2; } public function output() { echo $this->prop; echo get_class($this); } } $objA=new a(); $objB=new b(); $objA->change(); $objA->output(); $objB->change(); $objB->output();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $prop in /in/EIuEv on line 13 Deprecated: Creation of dynamic property b::$prop is deprecated in /in/EIuEv on line 21 2b

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