55

I have looked into YAML official documentation and I have also gone through some tutorials.

I am working with Symfony and I like adding configurations with YAML. But I can't find any explanation for this tilde character ~ in YAML.

For example, see the code below:

firewalls:
    # ...
    main:
        anonymous: ~
        http_basic: ~

Sometimes, I removed this ~ character and I did not see any effect on logic. So what is the purpose of this tide character in YAML?

Anthon
  • 69,918
  • 32
  • 186
  • 246
Eres
  • 1,559
  • 1
  • 16
  • 25

1 Answers1

65

The tilde is one of the ways the null value can be written. Most parsers also accept an empty value for null, and of course null, Null and NULL.

These are defined in the first two lines of the regular expressions for the core schema tags in the YAML standard.

Anthon
  • 69,918
  • 32
  • 186
  • 246