public function filter(callable $callback): ArrayObject
    {
        $arrayCopy = $this->getArrayCopy();
        $filteredData = array_filter($arrayCopy, $callback);
        return new ArrayObject($filteredData);
    }
public function filter(callable $callback): ArrayObject
    {
        $arrayCopy = $this->getArrayCopy();
        $filteredData = array_filter($arrayCopy, $callback);
        return new ArrayObject($filteredData);
    }
public function filter ( callable $ callback ) : ArrayObject { $ arrayCopy = $ this -> getArrayCopy ( ) ; $ filteredData = array_filter ( $ arrayCopy , $ callback ) ; return new ArrayObject ( $ filteredData ) ; }
Iterates over each value in the array passing them to the callback function.
If the callback function returns true, the current value from array is returned into the result ArrayObject. Array keys are preserved.
@param callable $callback
@return ArrayObject
Iterates over each value in the array passing them to the callback function . If the callback function returns true the current value from array is returned into the result ArrayObject . Array keys are preserved .