#27227 [Bgs->Opn]: Mixed case class names causes Fatal Error in Constructor call
| From: | waboring at 3gstech dot com | Date: | Mon, 15 Mar 2004 18:22:07 +0000 |
| Subject: | #27227 [Bgs->Opn]: Mixed case class names causes Fatal Error in Constructor call | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56513@lists.php.net to get a copy of this message | ||
ID: 27227
User updated by: waboring at 3gstech dot com
Reported By: waboring at 3gstech dot com
-Status: Bogus
+Status: Open
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2004-02-11
Assigned To: helly
New Comment:
This bug is far from bogus. You say that this using the name of the
class as a function is depricated for a constructor? Deprecated and
removed are two entirely different things.
If it's deprecated, it should be noted in the documentation that it's
deprecated, but it should still work. If what you mean by deprecated
is removed, then it should be consistent and be removed entirely.
If you name the class with no mixed case in the name, it works fine.
Change the name of the parent class to have mixed case, and it doesn't
work. It clearly points out how inconsistent php5 is. If php5 doesn't
support class name functions as the constructor, it should at least be
consistent.
Previous Comments:
------------------------------------------------------------------------
[2004-03-14 12:59:41] andi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Please use parent::__construct() to call the parent's constructor. We
don't support calling it via the object and definitely not using the
depricated fashion of using the classes name as the constructor name.
------------------------------------------------------------------------
[2004-03-03 14:29:08] derick@php.net
Anything new on this?
------------------------------------------------------------------------
[2004-02-20 04:37:17] sniper@php.net
Marcus, this fix wasn't quite enough.
------------------------------------------------------------------------
[2004-02-19 13:17:54] waboring at 3gstech dot com
Actually this hasn't been completely fixed. This is the same issue as
the original post. Please do not close this bug as it is NOT fixed.
This is the same issue. The first third child class can't resolve the
cascade of the constructor call back to the parent class just because
the case and name of the classes change.
<?php
class A {
function A() {
echo __CLASS__."::".__FUNCTION__." called!<br>\n";
}
}
class bTesting extends A {
function blah() {
echo __CLASS__."::".__FUNCTION__."() called<br>\n";
}
}
class c extends bTesting {
function c() {
echo __CLASS__."::".__FUNCTION__."() called!!<br>\n";
$this->bTesting();
}
}
$obj = new c();
$obj->blah();
?>
results in:
c::c() called!!
Fatal error: Call to undefined method c::bTesting() in
/home/waboring/devel/bug.php on line 18
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/27227
--
Edit this bug report at http://bugs.php.net/?id=27227&edit=1