Render blocks of HTML with Twig macro and arguments

Code
<?php

$path 
__DIR__ '/templates/';

$template = <<<ND
{% extends "base.html.twig" %}

{% block body %}
    <h5>First macro call</h5>
    {{ _self.foo(1) }}
    <h5>Second macro call</h5>
    {{ _self.foo(2, "Free ElePHPants") }}
{% endblock %}

{% macro foo(number, optional) %}
    Content no. {{ number }} -
    {{ optional|default("No optional addition") }}
{% endmacro %}
ND;
$name 'macro.html.twig';

$loaders = [
    new 
Twig\Loader\ArrayLoader([$name => $template]),
    new 
Twig\Loader\FilesystemLoader($path),
];
$loader = new Twig\Loader\ChainLoader($loaders);

$twig = new Twig\Environment($loader);

echo 
$twig->render($name);
Result

This is the Twig base template


The embedded template:

First macro call

Content no. 1 -
No optional addition

Second macro call

Content no. 2 -
Free ElePHPants

Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8