Automattic\WooCommerce\Utilities

ArrayUtil::deep_assoc_array_diff()public staticWC 1.0

Computes difference between two assoc arrays recursively. Similar to PHP's native assoc_array_diff, but also supports nested arrays.

Method of the class: ArrayUtil{}

No Hooks.

Return

Array. The difference between the two arrays.

Usage

$result = ArrayUtil::deep_assoc_array_diff( $array1, $array2, $strict ): array;
$array1(array) (required)
First array.
$array2(array) (required)
Second array.
$strict(true|false)
Whether to also match type of values.
Default: true

ArrayUtil::deep_assoc_array_diff() code WC 8.6.1

public static function deep_assoc_array_diff( array $array1, array $array2, bool $strict = true ): array {
	return self::deep_compute_or_compare_array_diff( $array1, $array2, false, $strict );
}