class ArrayOps (View source)

Methods

static array
circularDiffKeys(array $left, array $right)

Perform a circular diff between two arrays using keys.

static array
filterByKeys(array $array_of_keys, array $array_to_filter)

Filter an array by an array of keys

static array
replaceStrict(array $source, array ...$replace)

Replace items only if relative keys are actually defined in source array

Details

static array circularDiffKeys(array $left, array $right)

Perform a circular diff between two arrays using keys.

This method returns an array containing: [ [keys in $left array but not in $right], [keys in both %left and $right], [keys in $right but not in $left], ]

Parameters

array $left
array $right

Return Value

array

static array filterByKeys(array $array_of_keys, array $array_to_filter)

Filter an array by an array of keys

Parameters

array $array_of_keys
array $array_to_filter

Return Value

array

static array replaceStrict(array $source, array ...$replace)

Replace items only if relative keys are actually defined in source array

Parameters

array $source
array ...$replace

Return Value

array