3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getDay($day) { $days = ['Monday' => 1, 'Tuesday' => 2, 'Wednesday' => 3, 'Thursday' => 4, 'Friday' => 5, 'Saturday' => 6, 'Sunday' => 7]; $today = new \DateTime(); $today->setISODate($today->format('o'), $today->format('W'), $days[ucfirst($day)]); return $today; } var_dump(getDay('Monday')); $fulldate = getDay('Friday')->format('y') ."-".getDay('Friday')->format('m') ."-". getDay('Friday')->format('d') var_dump($fulldate);
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected 'var_dump' (T_STRING) in /in/mclFW on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/mclFW on line 4
Process exited with code 255.