src/ConfigTrait.php
protected function &_lookupConfigElement($path, $create_elements = false)
    {
        $path = explode('/', $path);
        $pos = &$this->config;
        foreach ($path as $el) {
            // create empty element if it doesn't exist
            if (!array_key_exists($el, $pos) && $create_elements) {
                $pos[$el] = [];
            }
            // if it still doesn't exist, then just return false (no error)
            if (!array_key_exists($el, $pos) && !$create_elements) {
                // trick to return false because we need reference here
                $false = false;

                return $false;
            }

            $pos = &$pos[$el];
        }

        return $pos;
    }
protected function &_lookupConfigElement($path, $create_elements = false)
    {
        $path = explode('/', $path);
        $pos = &$this->config;
        foreach ($path as $el) {
            // create empty element if it doesn't exist
            if (!array_key_exists($el, $pos) && $create_elements) {
                $pos[$el] = [];
            }
            // if it still doesn't exist, then just return false (no error)
            if (!array_key_exists($el, $pos) && !$create_elements) {
                // trick to return false because we need reference here
                $false = false;

                return $false;
            }

            $pos = &$pos[$el];
        }

        return $pos;
    }
protected function & _lookupConfigElement ( $ path , $ create_elements = false ) { $ path = explode ( '/' , $ path ) ; $ pos = & $ this -> config ; foreach ( $ path as $ el ) { // create empty element if it doesn't exist if ( ! array_key_exists ( $ el , $ pos ) && $ create_elements ) { $ pos [ $ el ] = [ ] ; } // if it still doesn't exist, then just return false (no error) if ( ! array_key_exists ( $ el , $ pos ) && ! $ create_elements ) { // trick to return false because we need reference here $ false = false ; return $ false ; } $ pos = & $ pos [ $ el ] ; } return $ pos ; }
Internal method to lookup config element by given path.

@param string $path            Path to navigate to
@param bool   $create_elements Should we create elements it they don't exist

@return &pos|false Pointer to element in $this->config or false is element don't exist and $create_elements===false
Returns false if element don't exist and $create_elements===false
Internal method to lookup config element by given path .