AudioDidact\GlobalFunctions::deepSetDictionaryValues
Sets the value of a dictionary subkey to $value.
Signature
public function deepSetDictionaryValues(array
$dict,
array
$keyHierarchy,
mixed
$value )
Parameters
$dict
—
array
- the dictionary that will have it's subkey set to $value.
$keyHierarchy
—
array
- the array of keys to set. To set something in the form of $array["a"]["b"]["c"],
set $keyHierarchy to ["a","b","c"]
$value
—
mixed
- the value that will be added to the dictionary
Returns
- mixed
- the dictionary with the new value set
Test Coverage
Information
- Coverage: 9/9 Lines (100%)
- Tests: 1
- Passed: 1 (100%)
Tests
- [ PASSED ] — UtilitiesTest::testDeepSetDictionaryValues