php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80059 Lowercase true/false should be used in code examples
Submitted: 2020-09-04 11:51 UTC Modified: 2020-09-04 12:26 UTC
From: t dot motylewski at gmail dot com Assigned:
Status: Verified Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: t dot motylewski at gmail dot com
New email:
PHP Version: OS:

 

 [2020-09-04 11:51 UTC] t dot motylewski at gmail dot com
Description:
------------
---
From manual page: https://php.net/language.types.boolean
---

According to PSR, boolean values should be written lowercase, eg.

$foo = false; 

and not 

$foo = FLASE;

Right now in many places in docs uppercase values are used, which confuses new users.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-04 12:00 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2020-09-04 12:00 UTC] cmb@php.net
> According to PSR, […]

PSR is irrelevant for the code examples in the PHP manual, since
these are supposed to follow the PEAR CS[1]; however, PEAR CS also
mandates that true, false and null must always be lowercase[2].

[1] <http://doc.php.net/tutorial/style.php>
[2] <https://pear.php.net/manual/en/standards.naming.php>
 [2020-09-04 12:26 UTC] t dot motylewski at gmail dot com
Thanks for the quick verification.
Its quite surprising that docs are not using PSR. I've created a separate ticket for this topic https://bugs.php.net/bug.php?id=80060
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 18:01:25 2020 UTC