From:             [EMAIL PROTECTED]
Operating system: linux/rh7.0 std
PHP version:      4.0.3pl1
PHP Bug Type:     Scripting Engine problem
Bug description:  Strange behaviour initialing extended class


PHP acts strangely when calling a parent class constructor from an extended class. 
PHP4 seems to call the constructor without arguments instead of the one with the right 
number of arguments.

Ari Nykänen

// -------- clip clip clip ----------------

<script language="php">
        class Huikkari {
                var $huikkasana="initial";
                function Huikkari($huikkasana) {
                function Huikkari() {
                function huikkaa () {
                        echo ($this->huikkasana."\n");
                        return true;

        class HelloHuikkari extends Huikkari {
                function helloHuikkari () {
// *** possible problem here *** the following line seems
// to call the Huikkari constructor with no arguments
                        $this->Huikkari('Hello World');

        $helloHuikkari = new HelloHuikkari();
// I think the following line should
// output 'Hello World' instead of 'defaultt'


Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to