private function parsePhpValue($key, $value, array &$result)
    {
        $node =& $result;
        $keyBuffer = '';

        for ($i = 0, $t = strlen($key); $i < $t; $i++) {
            switch ($key[$i]) {
                case '[':
                    if ($keyBuffer) {
                        $this->prepareNode($node, $keyBuffer);
                        $node =& $node[$keyBuffer];
                        $keyBuffer = '';
                    }
                    break;
                case ']':
                    $k = $this->cleanKey($node, $keyBuffer);
                    $this->prepareNode($node, $k);
                    $node =& $node[$k];
                    $keyBuffer = '';
                    break;
                default:
                    $keyBuffer .= $key[$i];
                    break;
            }
        }

        if (isset($node)) {
            $this->duplicates = true;
            $node[] = $value;
        } else {
            $node = $value;
        }
    }
private function parsePhpValue($key, $value, array &$result)
    {
        $node =& $result;
        $keyBuffer = '';

        for ($i = 0, $t = strlen($key); $i < $t; $i++) {
            switch ($key[$i]) {
                case '[':
                    if ($keyBuffer) {
                        $this->prepareNode($node, $keyBuffer);
                        $node =& $node[$keyBuffer];
                        $keyBuffer = '';
                    }
                    break;
                case ']':
                    $k = $this->cleanKey($node, $keyBuffer);
                    $this->prepareNode($node, $k);
                    $node =& $node[$k];
                    $keyBuffer = '';
                    break;
                default:
                    $keyBuffer .= $key[$i];
                    break;
            }
        }

        if (isset($node)) {
            $this->duplicates = true;
            $node[] = $value;
        } else {
            $node = $value;
        }
    }
private function parsePhpValue ( $ key , $ value , array & $ result ) { $ node = & $ result ; $ keyBuffer = '' ; for ( $ i = 0 , $ t = strlen ( $ key ) ; $ i < $ t ; $ i ++ ) { switch ( $ key [ $ i ] ) { case '[' : if ( $ keyBuffer ) { $ this -> prepareNode ( $ node , $ keyBuffer ) ; $ node = & $ node [ $ keyBuffer ] ; $ keyBuffer = '' ; } break ; case ']' : $ k = $ this -> cleanKey ( $ node , $ keyBuffer ) ; $ this -> prepareNode ( $ node , $ k ) ; $ node = & $ node [ $ k ] ; $ keyBuffer = '' ; break ; default : $ keyBuffer .= $ key [ $ i ] ; break ; } } if ( isset ( $ node ) ) { $ this -> duplicates = true ; $ node [ ] = $ value ; } else { $ node = $ value ; } }
Parses a PHP style key value pair.

@param string      $key    Key to parse (e.g., "foo[a][b]")
@param string|null $value  Value to set
@param array       $result Result to modify by reference
Parses a PHP style key value pair .