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
Votes:1
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
19 - 19 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC