php.net |  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

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

i have some code like this:

<?php	
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 ?

 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

<?php
  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] sniper@php.net
This won't change.

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC