3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $DAY = 1; class Days{ function __construc($d){ $this->day = $d ; } function addToDate(){ global $DAY; $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/pEtP5 on line 9 12
Output for 5.0.0 - 5.2.5
Notice: Undefined property: Days::$day in /in/pEtP5 on line 9 12
Output for 4.3.0 - 4.4.9
Notice: Undefined property: day in /in/pEtP5 on line 9 12