3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Base { private $_e; protected function setE() { $this->$_e++; } public function getE() { return $this->$_e; } } class Foo extends Base { public function __contruct() { $this->setE(); } } class Bar extends Base { public function __contruct() { $this->setE(); } } $foo = new Foo; //$bar = new Bar; echo $foo->getE();
based on 0gfHJ
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: _e in /in/KO6G6 on line 14 Notice: Undefined property: Foo::$ in /in/KO6G6 on line 14
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: _e in /in/KO6G6 on line 14 Fatal error: Uncaught Error: Cannot access empty property in /in/KO6G6:14 Stack trace: #0 /in/KO6G6(37): Base->getE() #1 {main} thrown in /in/KO6G6 on line 14
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Notice: Undefined variable: _e in /in/KO6G6 on line 14 Fatal error: Cannot access empty property in /in/KO6G6 on line 14
Process exited with code 255.