reproducing #8761 to bootstrap implementation

reference symfony/symfony#8761