3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestOne {} class TestTwo extends TestOne { public function __get($name) { return null; } } $one = new TestOne(); $one->scalar = 1; $one->array[] = 1; var_dump($one->scalar, $one->array); $two = new TestTwo(); $two->scalar = 1; $two->array[] = 1; var_dump($two->scalar, $two->array); $three = new TestTwo(); $three->scalar = 1; $three->array = []; $three->array[] = 1; var_dump($three->scalar, $three->array);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property TestOne::$scalar is deprecated in /in/d7IDK on line 12 Deprecated: Creation of dynamic property TestOne::$array is deprecated in /in/d7IDK on line 13 int(1) array(1) { [0]=> int(1) } Deprecated: Creation of dynamic property TestTwo::$scalar is deprecated in /in/d7IDK on line 18 Notice: Indirect modification of overloaded property TestTwo::$array has no effect in /in/d7IDK on line 19 int(1) NULL Deprecated: Creation of dynamic property TestTwo::$scalar is deprecated in /in/d7IDK on line 24 Deprecated: Creation of dynamic property TestTwo::$array is deprecated in /in/d7IDK on line 25 int(1) array(1) { [0]=> int(1) }

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:
27.73 ms | 407 KiB | 5 Q