Context of Static Method Calls

    Date: 09/27/07 (PHP Community)    Keywords: no keywords

    Take this:

    abstract class A {
        public static function foo() {
            $class = "Don't know...";
            echo "$class
    ";
        }
    }

    class B extends A {
    }

    class C extends A {
    }

    B::foo();
    C::foo();

    Is there a way to determine, inside the foo() method, whether it's being called as a method of B or of C?

    Source: http://community.livejournal.com/php/587764.html

« php bug? || Strange error.... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home