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
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: t dot motylewski at gmail dot com Assigned:
Status: Verified Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

Pull requests:

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
 [2022-04-28 16:21 UTC] kinggorghenry at yahoo dot com
The following pull request has been associated:

Patch Name: Ignore externally managed and generated files
On GitHub:  https://github.com/php/web-windows/pull/21
Patch:      https://github.com/php/web-windows/pull/21.patch
 [2022-04-28 16:36 UTC] maghsodid at yahoo dot com
The following pull request has been associated:

Patch Name: Prepare for longer commit hashes
On GitHub:  https://github.com/php/web-windows/pull/24
Patch:      https://github.com/php/web-windows/pull/24.patch
 [2022-04-28 16:38 UTC] maghsodid at yahoo dot com
The following pull request has been associated:

Patch Name: Fix issue with pt_BR not being updated
On GitHub:  https://github.com/php/systems/pull/15
Patch:      https://github.com/php/systems/pull/15.patch
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC