19 public static function getByPath($array, $path, $defaultValue =
null)
21 if(!is_array($array) && !$array instanceof \ArrayAccess)
23 throw new ArgumentException(
"\$array is not array or don't implement ArrayAccess");
26 $pathItems = explode(
'.', $path);
29 foreach($pathItems as $pathItem)
31 if(!is_array($lastArray) && !$lastArray instanceof \ArrayAccess)
36 if(!isset($lastArray[$pathItem]))
41 $lastArray = $lastArray[$pathItem];