On 12/10/2014 11:11, Nikita Popov wrote:
For example, things like this:
>
>  # style comments in ini files (since PHP 5.3)
>
>I don't think we should remove at all (or why is this even deprecated?!
>
Because ini files use ; for comments and not #.

I was curious enough about this to dig into source control and do some sleuthing, and it looks like what actually led to this situation was:

- Between 5.2 and 5.3 (late 2007 and early 2008), the ini parsing code saw a lot of heavy modifications [1], including a patch adding many new syntax features, and a subsequent rewrite from flex to re2c. - This, inevitably, led to a bunch of regressions. As later pointed out, the accepted format wasn't really documented in the first place. [2]
- One of those bugs had to do with the parsing of # characters. [3]
- The behaviour of # as comments in earlier versions seems to have been a side-effect of something else, rather than a deliberate feature. In fact, it was possible to have a key starting with #, but a line starting # that had no = was silently discarded. [4] - As a result, # was added back as an explicit comment character, but with a deprecation notice. [5]

My guess is that the reasoning was that semicolon was always the "correct" comment character, so people should be encouraged to use it.

Whether "deprecated" is the right word for that, I'm not sure.

[1] http://lxr.php.net/history/PHP_5_3/Zend/zend_ini_scanner.l
[2] https://bugs.php.net/bug.php?id=47703
[3] https://bugs.php.net/bug.php?id=44575
[4] http://3v4l.org/AoI5H
[5] http://lxr.php.net/diff/PHP_5_3/Zend/zend_ini_scanner.l?r2=%2FPHP_5_3%2FZend%2Fzend_ini_scanner.l%40b3d0514b6f87af37a7750a0f4c95e4a12a8f7009&r1=%2FPHP_5_3%2FZend%2Fzend_ini_scanner.l%40193dd31a22a52cfdbd30135b1025ca774d1e98b4

--
Rowan Collins
[IMSoP]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to