Hi All,

I have a class and a subclass, both with a static method:

<?php
class Foo
{
        static function Bar()
        {
                self::Baz();
        }
}

class Foo2 extends Foo
{
        static function Baz()
        {
                echo 'Baz';
        }
}

Foo2::Bar();
?>

In this case I expect to find 'Baz' on my screen, but I get the following: "Fatal error: Call to undefined method Foo::baz() in d:\htdocs_php5\ProBase2\TRUNK\probase\libsys\test5.php on line 7".

This is in PHP5 RC2.

Somehow this behaviour seems logical, on the other hand I don't think it's desired. I think that 'self' should point to the current class, even if the static method resides in a parent class.

Is this 'self'-behaviour intended?

Bert

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to