Open lesilent opened 1 year ago
Well, comments always start with a semicolon, but the semicolon doesn't have to be the first character of a line. That basically works like one-line PHP comments. The php.ini example on https://www.php.net/manual/en/configuration.file.php already explains that, so I'm not sure whether we need to clarify this for parse_ini_*()
.
I stumbled upon this "feature" concerning how parse_ini_file (and parse_ini_string) handles comments. For the longest time I thought comments started with a semi-colon, After all, that's how it's done in php.ini and the sample in Example # 1 for parse_ini_file states:
; Comments start with ';', as in php.ini
But recently I noticed that Example # 5 has an in-line comment:
quoted = "She said \"Exactly my point\"." ; Results in a string with quote marks in it.
So I tested that, and much to my surprise, inline-comments are indeed supported by parse_ini_file and parse_ini_string. It might be helpful to make that a bit more clear and/or update the line in example # 1 stating that comments typically start with a semi-colon (but not always).