8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a8e74a commit fe7f5c5Copy full SHA for fe7f5c5
components/yaml.rst
@@ -293,6 +293,17 @@ flag::
293
// Line
294
// String
295
296
+Parsing PHP Constants
297
+~~~~~~~~~~~~~~~~~~~~~
298
+
299
+By default, the YAML parser treats the PHP constants included in the contents as
300
+regular strings. Use the ``PARSE_CONSTANT`` flag and the special ``!php/const:``
301
+syntax to parse them as proper PHP constants::
302
303
+ $yaml = '{ foo: PHP_INT_SIZE, bar: !php/const:PHP_INT_SIZE }';
304
+ $parameters = Yaml::parse($yaml, Yaml::PARSE_CONSTANT);
305
+ // $parameters = array('foo' => 'PHP_INT_SIZE', 'bar' => 8);
306
307
Syntax Validation
308
~~~~~~~~~~~~~~~~~
309
0 commit comments