src/Loops/Element.php
public function offsetUnset($offset) {
        $detach = NULL;

        if(parent::offsetExists($offset)) {
            $child = parent::offsetGet($offset);
            if($child instanceof Element && $child->__parent === $this) {
                $detach = $child;
            }
        }

        parent::offsetUnset($offset);

        if($detach) {
            $detach->detach();
        }
    }
public function offsetUnset($offset) {
        $detach = NULL;

        if(parent::offsetExists($offset)) {
            $child = parent::offsetGet($offset);
            if($child instanceof Element && $child->__parent === $this) {
                $detach = $child;
            }
        }

        parent::offsetUnset($offset);

        if($detach) {
            $detach->detach();
        }
    }
public function offsetUnset ( $ offset ) { $ detach = NULL ; if ( parent :: offsetExists ( $ offset ) ) { $ child = parent :: offsetGet ( $ offset ) ; if ( $ child instanceof Element && $ child -> __parent === $ this ) { $ detach = $ child ; } } parent :: offsetUnset ( $ offset ) ; if ( $ detach ) { $ detach -> detach ( ) ; } }
Automatically detaches child elements if they belong to this element

@param string The offset
Automatically detaches child elements if they belong to this element