code: private function keyValToArray($key, $val)
      {
          $new = array();
          $path = \preg_split('#[\./]#', $key);
          $ref = &$new;
          foreach ($path as $k) {
              $ref[$k] = array(); // initialize this level
              $ref = &$ref[$k];
          }
          $ref = $val;
          return $new;
      }
docs: Convert key/path & val to array
  
  @param string $key key or path
  @param mixed  $val value
  
  @return array