Remove an element from an array

the item is searched and removed, numeric arrays are renumbered
only the first item matched will be removed
@TODO FIXME: boolean trap
@param bool $searchStrict if false only the value will be replace
@return array
422224
public static function remove(Array &$array, $item, $searchStrict = TRUE) {
    if (($key = array_search($item, $array, $searchStrict)) !== FALSE) {
      array_splice($array, $key, 1);
    }
    
    return $array;
  }
90254
public function findArray(Search $search)
    {
        $results = $this->executeSearch($search);

        return new ArrayIterator(
            $results,
            $this->getManager(),
            $this->getScrollConfiguration($results, $search->getScroll())
        );
    }
380530
public static function removePath($search_path)
    {
        $index = array_search($search_path, self::$search_paths);
        if ($index !== false) {
            array_splice(self::$search_paths, $index, 1);
        }
    }
1166152
public static function removePrefix($haystack, $prefix)
    {
        if (!is_string($haystack) || !is_string($prefix)) {
            throw new \InvalidArgumentException('Not a string');
        }

        if (strpos($haystack, $prefix) === 0) {
            $haystack = substr($haystack, strlen($prefix));
        }

        return $haystack;
    }
1176560
public function delRightMost( $sSearch ) {
		$sSource = $this->value;
		for ( $i = strlen( $sSource ); $i >= 0; $i = $i - 1 ) {
			$f = strpos( $sSource, $sSearch, $i );
			if ( $f !== false ) {
				return new GString( substr( $sSource, 0, $f ) );
				break;
			}
		}

		return new GString( $sSource );
	}
1227147
public function remove(int $start, int $length = null) : ArrayList
    {
        $values = $this->_remove($start, $length);
        $this->setValues($values);
        return $this;
    }
154586
public function arrayFilterEmptyRecursive($haystack)
    {
        foreach ($haystack as $key => $value) {
            if (is_array($value)) {
                $haystack[$key] = $this->arrayFilterEmptyRecursive($haystack[$key]);
            }
            if (empty($haystack[$key])) {
                unset($haystack[$key]);
            }
        }

        return $haystack;
    }
197758
private function removeEmptyValues(array $haystack)
    {
        foreach ($haystack as $key => $value) {
            if (is_array($value)) {
                $haystack[$key] = $this->removeEmptyValues($value);
            }
            // remove empty values value value is NULL or an empty string ''
            if ($value === null || $value == '') {
                unset($haystack[$key]);
            }
        }
        
        return $haystack;
    }
277527
public function indexOf($searchValue, $fromIndex = 0)
    {
        if (empty($searchValue) === true) {
            return $fromIndex;
        }

        $result = strpos($this->subject, $searchValue, $fromIndex);

        return $result === false ? -1 : $result;
    }
1075162
public function removeAt($position)
    {
        if (!is_numeric($position) || $position < 0) {
            throw new \InvalidArgumentException();
        }

        if ($position < count($this->items)) {
            array_splice($this->items, $position, 1);
        }

        $this->isUpdated = true;

        return $this;
    }
546387
public static function removeVal(&$haystack, $needle, $strict = true)
    {
        $count = 0;
        if (\is_array($haystack)) {
            // PHP 4 doesn't have 3rd array_keys() param -> perform strict check in loop
            $keys = \array_keys($haystack, $needle);
            foreach ($keys as $k) {
                if ($strict && $haystack[$k] !== $needle) {
                    continue;
                }
                unset($haystack[$k]);
                $count++;
            }
        }
        return $count;
    }
573117
public function intersection(array $search, bool $keepKeys = false): self
    {
        if ($keepKeys) {
            return static::create(
                \array_uintersect(
                    $this->array,
                    $search,
                    static function ($a, $b) {
                        return $a === $b ? 0 : -1;
                    }
                ),
                $this->iteratorClass,
                false
            );
        }

        return static::create(
            \array_values(\array_intersect($this->getArray(), $search)),
            $this->iteratorClass,
            false
        );
    }
1079245
private function delete(int $position)
    {
        $pair  = $this->pairs[$position];
        $value = $pair->value;

        array_splice($this->pairs, $position, 1, null);
        $this->checkCapacity();

        return $value;
    }
788429
private String removeBeginningAt(final String input,
            final String searchString) {
        final int i = input.indexOf(searchString);
        if (i != -1) {
            return input.substring(i + 1, input.length());
        }
        return input;
    }
881806
public function replaceOneValue($search, $replacement = ''): self
    {
        $array = $this->getArray();
        $key = \array_search($search, $array, true);

        if ($key !== false) {
            $array[$key] = $replacement;
        }

        return static::create(
            $array,
            $this->iteratorClass,
            false
        );
    }
759728
public static function removeFirst(string $subject, string $search, bool $caseSensitive = true): string
    {
        return static::replaceFirst($subject, $search, '', $caseSensitive);
    }
119758
public function removeAllAttributes(array $exclusions = [])
    {
        if (!$this->node instanceof DOMElement) {
            return $this;
        }

        foreach ($this->attributes() as $name => $value) {
            if (in_array($name, $exclusions, true)) {
                continue;
            }

            $this->node->removeAttribute($name);
        }

        return $this;
    }