in src/datetime/DateTime/DateTime.php [144:155]
final public function getISOWeekNumber(): (int, int) { // year, week number
$year = $this->year;
$week = $this->getISOWeekNumberImpl();
// the current day may be part of the first/last ISO week of the
// next/previous year
if ($this->month === 12 && $week === 1) {
++$year;
} else if ($this->month === 1 && $week > 50) {
--$year;
}
return tuple($year, $week);
}