Bug #11589 Updated: classes and includes
| From: | lenar at dotcom dot ee | Date: | Thu, 21 Jun 2001 12:24:33 +0000 |
| Subject: | Bug #11589 Updated: classes and includes | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57525@lists.php.net to get a copy of this message | ||
ID: 11589
User Update by: lenar@dotcom.ee
Status: Open
Bug Type: Scripting Engine problem
Operating system: Debian/Linux
PHP Version: 4.0.5
Description: classes and includes
The bug exists in 4.0.6 RC3
Previous Comments:
---------------------------------------------------------------------------
[2001-06-20 14:59:26] lenar@dotcom.ee
First, my stripped down code that works:
<?
class a {
function make($params) {
}
}
class b extends a {
function make() {
echo "WORKS OK";
}
}
class c extends b {
function make($params) {
parent::make();
}
}
class d extends c {
function make($params) {
parent::make($params);
}
}
$d = new d();
$d->make("whatever");
?>
now, when i remove the definition of class 'a' to another file and include
the file like this:
file1.php:
<?
class a {
function make($params) {
}
}
?>
file2.php:
<?
include "./file1.php"; // or require - no difference
class b extends a {
function make() {
echo "WORKS OK";
}
}
class c extends b {
function make($params) { // this gets called forever !!!! and generating
warnings
parent::make();
}
}
class d extends c {
function make($params) {
parent::make($params);
}
}
$d = new d();
$d->make("whatever");
?>
then i get message 'Warning: Missing argument 1 for make()' ... the code is same ... but
working differently. at least with my php 4.0.5. so i think this is a bug.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=11589