public function getGlobals($withExtensions = false)
    {
        $globals = $this->globals;

        if ($withExtensions) {
            $temp = [];

            foreach ((array) $this->getExtensions() as $extension) {
                $temp = array_merge($temp, (array) $extension->getGlobals());
            }

            $globals = array_merge($temp, $globals);
        }

        return $globals;
    }