• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/session/legacy/lazysessionstart.php
  • Класс: BitrixMainSessionLegacyLazySessionStart
  • Вызов: LazySessionStart::register
static function register(): void
{
	if (self::$instance)
	{
		throw new InvalidOperationException("LazySessionStart was already registered.");
	}

	// It's very important to make a reference to the LazySessionStart object,
	// because when somebody uses $_SESSION['d'] += $value;
	// it converts to: offsetGet & offsetSet. But PHP destroys
	// the object because it'll be the last reference and offsetSet crashes.
	$_SESSION = self::$instance = new self();
}