3v4l.org

run code in 300+ PHP versions simultaneously
<?php $year = date('Y'); $week_count = date('W', strtotime($year . '-12-31')); if ($week_count == '01') { $week_count = date('W', strtotime($year . '-12-24')); } echo $week_count;

preferences:
40.54 ms | 402 KiB | 5 Q