static array | parse(string $value, bool $exceptionOnInvalidType = false, bool $objectSupport = false, bool $objectForMap = false, array $references = array()) Converts a YAML string to a PHP array. | |
static string | dump(mixed $value, bool $exceptionOnInvalidType = false, bool $objectSupport = false) Dumps a given PHP variable to a YAML string. | |
static string | parseScalar(string $scalar, string $delimiters = null, array $stringDelimiters = array('"', '\''), int $i, bool $evaluate = true, array $references = array()) Parses a scalar to a YAML string. | |
static array
parse(string $value, bool $exceptionOnInvalidType = false, bool $objectSupport = false, bool $objectForMap = false, array $references = array())
Converts a YAML string to a PHP array.
Parameters
string | $value | A YAML string |
bool | $exceptionOnInvalidType | true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise |
bool | $objectSupport | true if object support is enabled, false otherwise |
bool | $objectForMap | true if maps should return a stdClass instead of array() |
array | $references | Mapping of variable names to values |
Return Value
array | A PHP array representing the YAML string |
Exceptions
static string
dump(mixed $value, bool $exceptionOnInvalidType = false, bool $objectSupport = false)
Dumps a given PHP variable to a YAML string.
Parameters
mixed | $value | The PHP variable to convert |
bool | $exceptionOnInvalidType | true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise |
bool | $objectSupport | true if object support is enabled, false otherwise |
Return Value
string | The YAML string representing the PHP array |
Exceptions
static string
parseScalar(string $scalar, string $delimiters = null, array $stringDelimiters = array('"', '\''), int $i, bool $evaluate = true, array $references = array())
Parses a scalar to a YAML string.
Parameters
string | $scalar | |
string | $delimiters | |
array | $stringDelimiters | |
int | $i | &$i |
bool | $evaluate | |
array | $references | |
Return Value
Exceptions