3v4l.org

run code in 300+ PHP versions simultaneously
<?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; } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.60.0180.04811.98
5.4.50.0220.04111.98
5.4.40.0170.04511.97
5.4.30.0280.06511.96
5.4.20.0440.07711.96
5.4.10.0300.06511.96
5.4.00.0220.04811.46
5.3.160.0280.07112.68
5.3.150.0260.04312.67
5.3.140.0300.07112.66
5.3.130.0230.04312.66
5.3.120.0260.05812.66
5.3.110.0430.05312.66
5.3.100.0210.04812.12
5.3.90.0260.06912.08
5.3.80.0270.03912.08
5.3.70.0280.06912.07
5.3.60.0270.06812.06
5.3.50.0170.05012.00
5.3.40.0170.04712.00
5.3.30.0320.06611.94
5.3.20.0250.06711.73
5.3.10.0340.05811.69
5.3.00.0270.04511.67

preferences:
136.08 ms | 1394 KiB | 7 Q