Re: Change &null; from NULL to null, etc.

From: Date: Fri, 02 Dec 2016 19:09:44 +0000
Subject: Re: Change &null; from NULL to null, etc.
References: 1 2  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969386411@lists.php.net to get a copy of this message
On 02.12.2016 at 10:25, Peter Cowburn wrote: > On 25 November 2016 at 14:16, Christoph M. Becker <cmbecker69@gmx.de> wrote: > >> Since a long time there is a patch from Marco Pivetta in the online >> editor suggesting to change some initializers from >> &null; to null, >> and I wonder if we should change the definition of the entities >> &null;, &false; and >> &true; from upper case to lower case. While >> constants are usually written all upper case, these three reserved words >> are commonly spelled in lower case, what is required by PSR-2[1] and the >> PEAR coding standards[2]. >> >> Thoughts? > > I have no strong thoughts either way and it seems like change for change's > sake. I like the distinction between NULL the value and null the type, but > that's about all that's going for the existing convention.. Thanks, Peter and Maciej, for your replies. As there is no concensus to change it, I'm fine with leaving the current entity definitions. > As an aside, since you mentioned the PEAR coding standards which our > examples are supposed to follow, it appears that a majority of our examples > use the lower-case names already, though those using the uppercase names is > not small. It might be worth making them consistent. ACK. We should follow our own rules. :-) Minor nitpick, though: IMHO, the PEAR CS are obsolete, because they don't cater to newer features (such as namespaces[3]), and apparently nobody cares to bring them up-to-date[4]. Hence, it might be appropriate to switch to some contemporary coding style, such as PSR-2 – even though that might not even make a real difference for the doc's examples. >> [1] >> <http://www.php-fig.org/psr/psr-2/#2-5-keywords-and-true-false-null> >> [2] >> <https://pear.php.net/manual/en/standards.naming.php> [3] <https://pear.php.net/manual/en/standards.naming.php> [4] <http://pear.php.net/bugs/bug.php?id=21036> -- Christoph M. Becker

« previous php.doc (#969386411) next »