public static function remove(array &$array, $keyPath)
    {
        self::checkKeyPathIsValidAndNonEmpty($keyPath);
        $result = $array;
        $keys = self::explodeKeys(strval($keyPath));
        $ptr = &$result;

        while ($keys !== array()) {
            $key = array_shift($keys);

            if (!array_key_exists($key, $ptr)) {
                $ptr[$key] = array();
                $ptr = &$ptr[$key];
                continue;
            }
            $prevPtr = &$ptr;
            $ptr = &$ptr[$key];
            if ($keys === array()) {
                unset($prevPtr[$key]);
                $array = $result;
                return;
            }
            elseif (!is_array($ptr)) {
                throw new KeyNotFound($keyPath);
            }
        }

        throw new KeyNotFound($keyPath);
    }