PHP5: expected __METHOD__ behavior

From: Date: Sat, 22 May 2004 00:07:16 +0000
Subject: PHP5: expected __METHOD__ behavior
Groups: php.internals 
Request: Send a blank email to internals+get-10018@lists.php.net to get a copy of this message
I am by no means an expert with OOP, so if this is a blatantly retarded question please excuse my ignorance. Given this code: <?php class A {
    function foo()
    {
        echo __METHOD__;
    }
} class B {
    function bar()
    {
        // blah
    }
} $instance = B::foo(); ?> output is "A::foo". Is this correct? I would expect (want maybe :) ) to see output as "B::foo". If you need more information please let me know. TIA -dan

« previous php.internals (#10018) next »