public static function load($value)
  {
    $value = trim($value);

    if (0 == strlen($value)) {
      return '';
    }

    if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
      $mbEncoding = mb_internal_encoding();
      mb_internal_encoding('ASCII');
    }

    switch ($value[0]) {
      case '[':
        $result = self::parseSequence($value);
        break;
      case '{':
        $result = self::parseMapping($value);
        break;
      default:
        $result = self::parseScalar($value);
    }

    if (isset($mbEncoding)) {
      mb_internal_encoding($mbEncoding);
    }

    return $result;
  }
public static function load($value)
  {
    $value = trim($value);

    if (0 == strlen($value)) {
      return '';
    }

    if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
      $mbEncoding = mb_internal_encoding();
      mb_internal_encoding('ASCII');
    }

    switch ($value[0]) {
      case '[':
        $result = self::parseSequence($value);
        break;
      case '{':
        $result = self::parseMapping($value);
        break;
      default:
        $result = self::parseScalar($value);
    }

    if (isset($mbEncoding)) {
      mb_internal_encoding($mbEncoding);
    }

    return $result;
  }
public static function load ( $ value ) { $ value = trim ( $ value ) ; if ( 0 == strlen ( $ value ) ) { return '' ; } if ( function_exists ( 'mb_internal_encoding' ) && ( ( int ) ini_get ( 'mbstring.func_overload' ) ) & 2 ) { $ mbEncoding = mb_internal_encoding ( ) ; mb_internal_encoding ( 'ASCII' ) ; } switch ( $ value [ 0 ] ) { case '[' : $ result = self :: parseSequence ( $ value ) ; break ; case '{' : $ result = self :: parseMapping ( $ value ) ; break ; default : $ result = self :: parseScalar ( $ value ) ; } if ( isset ( $ mbEncoding ) ) { mb_internal_encoding ( $ mbEncoding ) ; } return $ result ; }
Convert a YAML string to a PHP array.

@param string $value A YAML string

@return array A PHP array representing the YAML string
Convert a YAML string to a PHP array .