public function diffRecursive(array $array = [], $helperVariableForRecursion = null): self
    {
        // init
        $result = [];

        if (
            $helperVariableForRecursion !== null
            &&
            \is_array($helperVariableForRecursion)
        ) {
            $arrayForTheLoop = $helperVariableForRecursion;
        } else {
            $arrayForTheLoop = $this->getGenerator();
        }

        foreach ($arrayForTheLoop as $key => $value) {
            if ($value instanceof self) {
                $value = $value->getArray();
            }

            if (\array_key_exists($key, $array)) {
                if ($value !== $array[$key]) {
                    $result[$key] = $value;
                }
            } else {
                $result[$key] = $value;
            }
        }

        return static::create(
            $result,
            $this->iteratorClass,
            false
        );
    }
public function diffRecursive(array $array = [], $helperVariableForRecursion = null): self
    {
        // init
        $result = [];

        if (
            $helperVariableForRecursion !== null
            &&
            \is_array($helperVariableForRecursion)
        ) {
            $arrayForTheLoop = $helperVariableForRecursion;
        } else {
            $arrayForTheLoop = $this->getGenerator();
        }

        foreach ($arrayForTheLoop as $key => $value) {
            if ($value instanceof self) {
                $value = $value->getArray();
            }

            if (\array_key_exists($key, $array)) {
                if ($value !== $array[$key]) {
                    $result[$key] = $value;
                }
            } else {
                $result[$key] = $value;
            }
        }

        return static::create(
            $result,
            $this->iteratorClass,
            false
        );
    }
public function diffRecursive ( array $ array = [ ] , $ helperVariableForRecursion = null ) : self { // init $ result = [ ] ; if ( $ helperVariableForRecursion !== null && \ is_array ( $ helperVariableForRecursion ) ) { $ arrayForTheLoop = $ helperVariableForRecursion ; } else { $ arrayForTheLoop = $ this -> getGenerator ( ) ; } foreach ( $ arrayForTheLoop as $ key => $ value ) { if ( $ value instanceof self ) { $ value = $ value -> getArray ( ) ; } if ( \ array_key_exists ( $ key , $ array ) ) { if ( $ value !== $ array [ $ key ] ) { $ result [ $ key ] = $ value ; } } else { $ result [ $ key ] = $ value ; } } return static :: create ( $ result , $ this -> iteratorClass , false ) ; }
Return values that are only in the current multi-dimensional array.

@param array      $array
@param array|null $helperVariableForRecursion <p>(only for internal usage)</p>

@return static
<p>(Immutable)</p>
Return values that are only in the current multi - dimensional array .