3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SimpleClass { public $var = 'a default value'; public function displayVar() { echo $this->var; } } class dog { public $honey = 'fdfd'; public function goat() { $this->honey = new Simpleclass(); $this->honey->va = 'super'; } } class moo extends dog { public function __construct() { $this->goat(); } } $dog = new dog; echo $dog->honey, PHP_EOL; $dog->honey = new Simpleclass(); $dog->honey->va = 'super'; echo $dog->honey->va, PHP_EOL; $dog2 = new dog; $dog2->goat(); echo $object->honey->va, PHP_EOL; $moo = new moo; echo $moo->honey->va;
Output for git.master, git.master_jit, rfc.property-hooks
fdfd Deprecated: Creation of dynamic property SimpleClass::$va is deprecated in /in/ZBnJn on line 39 super Deprecated: Creation of dynamic property SimpleClass::$va is deprecated in /in/ZBnJn on line 19 Warning: Undefined variable $object in /in/ZBnJn on line 44 Warning: Attempt to read property "honey" on null in /in/ZBnJn on line 44 Warning: Attempt to read property "va" on null in /in/ZBnJn on line 44 Deprecated: Creation of dynamic property SimpleClass::$va is deprecated in /in/ZBnJn on line 19 super

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:
99.9 ms | 402 KiB | 8 Q