Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit445d282

Browse files
jeromemaciasweaverryan
authored andcommitted
Fix php/object type example
1 parent5bdadef commit445d282

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎components/yaml.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ You can dump objects by using the ``DUMP_OBJECT`` flag::
250250
$object->foo = 'bar';
251251

252252
$dumped = Yaml::dump($object, 2, 4, Yaml::DUMP_OBJECT);
253-
// !php/object O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}
253+
// !php/object'O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}'
254254

255255
And parse them by using the ``PARSE_OBJECT`` flag::
256256

@@ -276,7 +276,7 @@ By default the parser will encode invalid types as ``null``. You can make the
276276
parser throw exceptions by using the ``PARSE_EXCEPTION_ON_INVALID_TYPE``
277277
flag::
278278

279-
$yaml = '!php/object O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}';
279+
$yaml = '!php/object\'O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}\'';
280280
Yaml::parse($yaml, Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE); // throws an exception
281281

282282
Similarly you can use ``DUMP_EXCEPTION_ON_INVALID_TYPE`` when dumping::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp