public function isInHive($bee)
    {
        // Check objects.
        if (is_object($bee) === true) {
            return $this->recursionHive->contains($bee);
        }

        // Check arrays (only the $GLOBAL array may apply).
        if (isset($bee[$this->recursionMarker]) === true) {
            // We render the $GLOBALS only once.
            if ($this->globalsWereRendered === true) {
                return true;
            }

            $this->globalsWereRendered = true;
        }

        // Should be a normal array. We do not track these, because we can not
        // resolve them via JS recursion handling.
        return false;
    }