private function OpCacheDataModel::_arrayPset in Production check & Production monitor 6
Same name and namespace in other branches
- 7 includes/prod_check.opcache.inc \OpCacheDataModel::_arrayPset()
1 call to OpCacheDataModel::_arrayPset()
File
- includes/prod_check.opcache.inc, line 274 
Class
Code
private function _arrayPset(&$array, $key, $value) {
  if (is_null($key)) {
    return $array = $value;
  }
  $keys = explode(DIRECTORY_SEPARATOR, ltrim($key, DIRECTORY_SEPARATOR));
  while (count($keys) > 1) {
    $key = array_shift($keys);
    if (!isset($array[$key]) || !is_array($array[$key])) {
      $array[$key] = array();
    }
    $array =& $array[$key];
  }
  $array[array_shift($keys)] = $value;
  return $array;
}