3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function lastWeekDay ($mnt) { $result = strtotime("last day of $mnt"); $day = date('D', $result); if ('Sun' === $day) { $result -= 86400 * 2; } if ('Sat' === $day) { $result -= 86400; } return $result; } echo date('Y-m-d', mktime(0,0,0,date('n')-1,1,date('Y')))
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected end of file, expecting ',' or ';' in /in/mhrT4 on line 17
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end, expecting ',' or ';' in /in/mhrT4 on line 17
Process exited with code 255.