Automattic\WooCommerce\Utilities
ArrayUtil::deep_assoc_array_diff
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.
Returns
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() ArrayUtil::deep assoc array diff code WC 10.3.6
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 );
}