|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15675 get_class() returns only lower chars
Submitted: 2002-02-22 08:14 UTC Modified: 2003-04-25 11:56 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: reinicke at sience dot de Assigned:
Status: Wont fix Package: Class/Object related
PHP Version: 4.1.1 OS: linux & w2000
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.
Block user comment
Status: Assign to:
Bug Type:
From: reinicke at sience dot de
New email:
PHP Version: OS:


 [2002-02-22 08:14 UTC] reinicke at sience dot de

i have some code like this:

class getContentBlock  {
$obj = new getContentBlock();
$classname = get_class($obj);
echo "Class of Object: $classname !";

=> Class of Object: getcontentblock !

The value of $classname should "getContentBlock",
but i get "getcontentblock" !
This is incorrect and causes errors, Classnames are
case sensitiv.
Why is the return value in lower case ?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-22 08:33 UTC]
Classnames aren't case sensitive; if you write:

  class getContentBlock {
  $obj = new GeTcOnTeNtBlOcK();
  $classname = get_class($obj);
  echo "Class of Object: $classname !";                                                                                                                        ?>

It will work too.

That's because the internal class representation is insenstive (thus stored only in lowercase).

This may be subject of change in ZE2, susupending this report.
 [2003-04-25 11:56 UTC]
This won't change.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jan 28 14:05:52 2023 UTC