3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * 根据星期获取月份日期 * @param int $weenNum 星期0-6 * @return array $days 返回日期数组 */ public function getDateByWeek($weekNum,$month,$year) { $totalDays=date('t',strtotime(mktime(0,0,0,$month,1,$year)));//计算月份总天数 $days=array(); for($day=1;$day<=$totalDays;$day++) { $mkTime=mktime(0,0,0,$month,$day,$year); if(date('w',$mkTime)==$weekNum){ $days[]=date('Y-m-d',$mkTime); } } return $days; } ?>
Output for 5.4.0 - 5.4.6
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/Ar6aS on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.16
Parse error: syntax error, unexpected T_PUBLIC in /in/Ar6aS on line 8
Process exited with code 255.