3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $DAY = 1; class Days{ function __construct($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.0.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
67
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.4.9
Notice: Undefined property: day in /in/Bm5n9 on line 9 12