window.tracking = "first";'; Extensions::registerHtmlBlock('', 'head'); Extensions::registerHtmlBlock(static function () use (&$callbackValue): string { return $callbackValue; }, 'head'); $expected = '' . $callbackValue; if (Extensions::getHtmlBlocks('head') !== $expected) { throw new RuntimeException('Static and callback HTML blocks should render in registration order.'); } $callbackValue = ''; $expected = '' . $callbackValue; if (Extensions::getHtmlBlocks('head') !== $expected) { throw new RuntimeException('HTML-block callbacks should be evaluated each time their location is retrieved.'); } fwrite(STDOUT, "PASS: HTML blocks render strings and lazy callbacks.\n");