3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $year = 2013; $Jan1 = gmmktime(0, 0, 0, 1, 1, $year); $mydate = gmmktime(0, 0, 0, 11, 30, $year); $delta = (int)(($mydate - $Jan1) / (7 * 24 * 60 * 60)) + 1; echo 'weeknumber: ', $delta;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
weeknumber: 48