php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70412 capitalization typo in class name
Submitted: 2015-09-02 19:20 UTC Modified: 2015-09-02 23:20 UTC
From: alisonjo2786 at gmail dot com Assigned: cmb (profile)
Status: Closed 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: alisonjo2786 at gmail dot com
New email:
PHP Version: OS:

 

 [2015-09-02 19:20 UTC] alisonjo2786 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.oop5.visibility
---

(I could be wrong! but...)

In "Example #2 Method Declaration," almost at the end:

$myFoo = new foo();

The class definition is class Foo extends Bar, so I think this line should say Foo with a capital F:

$myFoo = new Foo();


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-02 21:12 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2015-09-02 21:12 UTC] cmb@php.net
Either `new foo` as well as `new Foo` is valid, because class
names are case-insensitive. However, I agree that `new Foo` is
better suited for an example in the documentation at least.
 [2015-09-02 21:19 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=337714
Log: capitalized class name to match definition (fixes #70412)
 [2015-09-02 21:19 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2015-09-02 21:19 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2015-09-02 21:20 UTC] alisonjo2786 at gmail dot com
-Status: Closed +Status: Assigned
 [2015-09-02 21:20 UTC] alisonjo2786 at gmail dot com
Oh wow, I had no idea class names are case insensitive. I agree that using the same case is a good idea in the context of documentation like this, but also, thank you very much for your quick and informative response.
 [2015-09-02 23:20 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2015-09-02 23:20 UTC] cmb@php.net
You're welcome.

Most identifiers are case-insensitive in PHP, the exceptions being
variables and constants (the latter not necessarily).

Please don't (re)-open the ticket when replying (unless the issue
isn't solved in your opinion). :)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 09:00:02 2026 UTC