@@ -243,7 +243,7 @@ You can dump objects by using the ``DUMP_OBJECT`` flag::
243
243
$object->foo = 'bar';
244
244
245
245
$dumped = Yaml::dump($object, 2, 4, Yaml::DUMP_OBJECT);
246
- // !php/object: O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}
246
+ // !php/object ' O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}'
247
247
248
248
And parse them by using the ``PARSE_OBJECT `` flag::
249
249
@@ -269,7 +269,7 @@ By default the parser will encode invalid types as ``null``. You can make the
269
269
parser throw exceptions by using the ``PARSE_EXCEPTION_ON_INVALID_TYPE ``
270
270
flag::
271
271
272
- $yaml = '!php/object: O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}';
272
+ $yaml = '!php/object \' O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}\' ';
273
273
Yaml::parse($yaml, Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE); // throws an exception
274
274
275
275
Similarly you can use ``DUMP_EXCEPTION_ON_INVALID_TYPE `` when dumping::
@@ -319,10 +319,10 @@ Parsing PHP Constants
319
319
~~~~~~~~~~~~~~~~~~~~~
320
320
321
321
By default, the YAML parser treats the PHP constants included in the contents as
322
- regular strings. Use the ``PARSE_CONSTANT `` flag and the special ``!php/const: ``
322
+ regular strings. Use the ``PARSE_CONSTANT `` flag and the special ``!php/const ``
323
323
syntax to parse them as proper PHP constants::
324
324
325
- $yaml = '{ foo: PHP_INT_SIZE, bar: !php/const: PHP_INT_SIZE }';
325
+ $yaml = '{ foo: PHP_INT_SIZE, bar: !php/const PHP_INT_SIZE }';
326
326
$parameters = Yaml::parse($yaml, Yaml::PARSE_CONSTANT);
327
327
// $parameters = array('foo' => 'PHP_INT_SIZE', 'bar' => 8);
328
328
0 commit comments