Re: [PHP4BETA] 4.0b3 Class/Function question.
| From: | Stephen J. Taranto | Date: | Fri, 19 Nov 1999 20:37:24 +0000 |
| Subject: | Re: [PHP4BETA] 4.0b3 Class/Function question. | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6525@lists.php.net to get a copy of this message | ||
Oops.. Sorry about the mistakes in that last email. I was interrupted
by the phone and hit send before proofreading. Correct version follows
....
Hi All -- I know this borders on a FAQ/RTFM, but I'll be damned if I
can find the answer. Is the following a bug or a dumb programmer?
/* Simplified psuedo code. */
<?php
class _Query {
function Query($q) {
echo "And the query is $q";
}
}
class Xyz extends _Query {
function Xyz ($val) {
echo "In Xyz($val) function...";
$this->Query("From Xyz()"); // Line 9 in the msg below
}
}
$x = new Xyz("steve");
/* This will produce the error message "Fatal error: Function call to a
non-function (query) in class_team.mfls on line 9". I haven't got it
quite nailed down but I'm beginning to suspect that calling a
function in the parent class from the "contructor" function of the child
is at least part of the problem. Not sure though. I don't have access
to all my source right now, but I'm pretty sure I did this succesfully
using 4.0b2.
Additional system info -- Apache 1.3.9, 4.0b3 module, RedHat 6.1 (kernel
2.0.32?).
*/
?>
Any ideas? Thanks in advance,
-Steve.