original_string: public function toValue($type = null, $valueAttribute = null)
      {
          $value = ($valueAttribute)? (string)$this[$valueAttribute] : (string)$this;
          $type = ($type)?: (string)$this['type'];
  
          switch ($type) {
              case 'int':
                  $value = (int)$value;
                  break;
  
              case 'float':
                  $value = (float)$value;
                  break;
  
              case 'bool':
                  $value = $this->_toBoolean($value);
                  break;
  
              case 'double':
                  $value = (double)$value;
                  break;
  
              case 'null':
                  $value = null;
                  break;
  
              case 'array':
                  $value = $this->toArray(true);
                  break;
          }
  
          return $value;
      }
code: public function toValue($type = null, $valueAttribute = null)
      {
          $value = ($valueAttribute)? (string)$this[$valueAttribute] : (string)$this;
          $type = ($type)?: (string)$this['type'];
  
          switch ($type) {
              case 'int':
                  $value = (int)$value;
                  break;
  
              case 'float':
                  $value = (float)$value;
                  break;
  
              case 'bool':
                  $value = $this->_toBoolean($value);
                  break;
  
              case 'double':
                  $value = (double)$value;
                  break;
  
              case 'null':
                  $value = null;
                  break;
  
              case 'array':
                  $value = $this->toArray(true);
                  break;
          }
  
          return $value;
      }
code_tokens: public function toValue ( $ type = null , $ valueAttribute = null ) { $ value = ( $ valueAttribute ) ? ( string ) $ this [ $ valueAttribute ] : ( string ) $ this ; $ type = ( $ type ) ? : ( string ) $ this [ 'type' ] ; switch ( $ type ) { case 'int' : $ value = ( int ) $ value ; break ; case 'float' : $ value = ( float ) $ value ; break ; case 'bool' : $ value = $ this -> _toBoolean ( $ value ) ; break ; case 'double' : $ value = ( double ) $ value ; break ; case 'null' : $ value = null ; break ; case 'array' : $ value = $ this -> toArray ( true ) ; break ; } return $ value ; }
docstring: To php value
  
  @param string $type
  @return mixed
docstring_tokens: To php value