3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public $publicProperty = array(); } class Bar { public function __get($name) { return $this->wrapped->$name; } } $bar = new Bar(new Foo()); $bar->publicProperty['example'] = 'Hello World!'; var_dump($bar->publicProperty);
Output for 5.2.6 - 7.1.0
Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Indirect modification of overloaded property Bar::$publicProperty has no effect in /in/GMVBC on line 18 Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 NULL
Output for 5.2.0 - 5.2.5
Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Indirect modification of overloaded property Bar::$publicProperty has no effect in /in/GMVBC on line 18 Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 NULL
Output for 5.1.0 - 5.1.6
Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 NULL
Output for 5.0.4 - 5.0.5
Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 Notice: Undefined property: Bar::$wrapped in /in/GMVBC on line 12 Notice: Trying to get property of non-object in /in/GMVBC on line 12 NULL
Output for 5.0.0 - 5.0.3
Fatal error: Cannot access undefined property for object with overloaded property access in /in/GMVBC on line 18
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/GMVBC on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/GMVBC on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/GMVBC on line 5
Process exited with code 255.