3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $anoA = 2014; $mobile = array(); //calc passover day $a= $anoA%19; $b = $anoA%4; $c = $anoA%7; $d = (19*$a + 24)%30; $e = (2*$b + 4*$c + 6*$d + 5)%7; if(($d+$e) > 9){ $day = $d+($e-9); $month = 4; //Case passover in April } else{ $day = $d+$e+22; $month = 3; //Case passover in Mrch } $date = new DateTime("$anoA-$month-$day"); $passover = $date->format("Y-m-d"); //Date of passover $date->modify("-47 day"); //Date of canirval $carnival = $date->format("Y-m-d"); $date->modify("+47 day"); /* $date->modify("-46 day"); //cinzas $cinzas = $date->format("Y-m-d"); $date->modify("+46 day"); */ /* $date->modify("-7 day"); //ramos $ramos = $date->format("Y-m-d"); $date->modify("+7 day"); */ $date->modify("-2 day"); //sexta santa $sextaSanta = $date->format("Y-m-d"); $date->modify("+2 day"); /* $date->modify("+39 day"); //ascencao $ascencao = $date->format("Y-m-d"); $date->modify("-39 day"); $date->modify("+49 day"); //pentecoste $pentecoste = $date->format("Y-m-d"); $date->modify("-49 day"); $date->modify("+56 day"); //santissima trindade $santissimaTrindade = $date->format("Y-m-d"); $date->modify("-56 day"); $date->modify("+60 day"); //corpo de cristo $corpoCristo = $date->format("Y-m-d"); $date->modify("-60 day"); */ $i = 0; /*$this->countryHolidays[$i]['description'] = $mod_strings["LBL_CINZAS"]; $this->countryHolidays[$i++]['date'] = $cinzas; $this->countryHolidays[$i]['description'] = $mod_strings["LBL_RAMOS"]; $this->countryHolidays[$i++]['date'] = $ramos;. */ /* $this->countryHolidays[$i]['description'] = $mod_strings["LBL_PASSOVER"]; $this->countryHolidays[$i++]['date'] = $passover; $this->countryHolidays[$i]['description'] = $mod_strings["LBL_CARNAVAL"]; $this->countryHolidays[$i++]['date'] = $carnival; $this->countryHolidays[$i]['description'] = $mod_strings["LBL_SEXTAFEIRASANTA"]; $this->countryHolidays[$i++]['date'] = $sextaSanta; */ /*$this->countryHolidays[$i]['description'] = $mod_strings["LBL_ASCENCAO"]; $this->countryHolidays[$i++]['date'] = $ascencao; $this->countryHolidays[$i]['description'] = $mod_strings["LBL_PENTECOSTE"]; $this->countryHolidays[$i++]['date'] = $pentecoste; $this->countryHolidays[$i]['description'] = $mod_strings["LBL_SANTISSIMATRINDADE"]; $this->countryHolidays[$i++]['date'] = $santissimaTrindade; $this->countryHolidays[$i]['description'] = $mod_strings["LBL_CORPODECRISTO"]; $this->countryHolidays[$i++]['date'] = $corpoCristo; */ //add mobile days $_SESSION['country_holidays'] = $this->countryHolidays; //array_push($mobile, $passover, $carnival, $cinzas, $ramos, $sextaSanta, $ascencao, $pentecoste, $santissimaTrindade, $corpoCristo); //remover feriados fixos //array_push($mobile, $passover, $carnival, $sextaSanta); //return $mobile; print_r($mobile); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/i6W5n:91 Stack trace: #0 {main} thrown in /in/i6W5n on line 91
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught Error: $this is null in /in/i6W5n:91 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: $this is null in /in/i6W5n on line 91
Process exited with code 255.
Output for 5.2.0 - 5.6.28
Fatal error: Using $this when not in object context in /in/i6W5n on line 91
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/i6W5n on line 21
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/i6W5n on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/i6W5n on line 21