3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $DAY = 1; class Days{ function __construc($d){ $this->day = $d ; } function addToDate(){ $this->day = $this->day + $DAY; return $this->day; } function modifyDay($d){ $DAY = $d; } } $p = new Days(5); echo $p->addToDate(); $p->modifyDay(8); echo $p->addToDate();
Output for 5.2.6 - 7.1.0
Notice: Undefined property: Days::$day in /in/PNfGr on line 8 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0
Output for 5.0.4 - 5.2.5
Notice: Undefined property: Days::$day in /in/PNfGr on line 8 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0
Output for 5.0.0 - 5.0.3
Notice: Undefined property: Days::$day in /in/PNfGr on line 8 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0
Output for 4.3.0 - 4.4.9
Notice: Undefined property: day in /in/PNfGr on line 8 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0 Notice: Undefined variable: DAY in /in/PNfGr on line 8 0