#27227 [Bgs->Csd]: Mixed case class names causes Fatal Error in Constructor call

From: Date: Thu, 19 Feb 2004 09:47:24 +0000
Subject: #27227 [Bgs->Csd]: Mixed case class names causes Fatal Error in Constructor call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55185@lists.php.net to get a copy of this message
 ID:               27227
 Updated by:       sniper@php.net
 Reported By:      waboring at 3gstech dot com
-Status:           Bogus
+Status:           Closed
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5CVS-2004-02-11
 Assigned To:      helly


Previous Comments:
------------------------------------------------------------------------

[2004-02-15 19:28:42] helly@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2004-02-11 20:33:03] sniper@php.net

Works fine with PHP 4 btw. :) (somehow I think this might be one for
Marcus to fix..?)



------------------------------------------------------------------------

[2004-02-11 19:20:49] waboring at 3gstech dot com

Description:
------------
I have 3 classes a, b extends a, c extends b.

b doesn't have constructor.

c class contructor calls b's constructor in an effort
to cascade constructor calls up the class heirarchy.

This works great until class 'a' is renamed to 'A'.

<?php
/* This script works as one would expect.
  The foo class constructor gets called.
 */
class a {
    function a() {
        echo __CLASS__."::".__FUNCTION__." called!<br>\n";
    }
}

class b extends a {

    function blah() {
        echo __CLASS__."::".__FUNCTION__."() called<br>\n";
    }
}

class c extends b {
    function c() {
        echo __CLASS__."::".__FUNCTION__."() called!!<br>\n";
        $this->b();
    }
}

$obj = new c();
$obj->blah();

/* Output is
c::c() called!!
a::a called!
b::blah() called
*/
?>



Reproduce code:
---------------
<?php
/* 
  Notice that the only thing that is different here is the
  case of the 'a' class changed to 'A' in all the appropriate places. 
Now I get a Fatal error saying
c::b() doesn't exist?

*/

class A {
    function A() {
        echo __CLASS__."::".__FUNCTION__." called!<br>\n";
    }
}

class b extends A {

    function blah() {
        echo __CLASS__."::".__FUNCTION__."() called<br>\n";
    }
}

class c extends b {
    function c() {
        echo __CLASS__."::".__FUNCTION__."() called!!<br>\n";
        $this->b();
        //ERROR IN LINE ABOVE
    }
}

$obj = new c();
$obj->blah();

/* Output is

c::c() called!!

Fatal error: Call to undefined method c::b() in
/home/waboring/devel/php/oop.php on line 18

*/
?>

Expected result:
----------------
I expect that both of the scripts would work the same way.  I have many
classes that have Mixed case 

Actual result:
--------------
Fatal error: Call to undefined method c::b() in
/home/waboring/devel/php/oop.php on line 18




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27227&edit=1


Thread (18 messages)

« previous php.bugs (#55185) next »