ID: 9005
Updated by: zeev
Old-Status: Open
Status: Closed
Bug Type: Scripting Engine problem
Assigned To: 

class::method() isn't a static call in PHP (it isn't always a static call in C++ 
The primary use for class::method() is actually calling methods from your parent 
class, not calling 'static methods' (the ability to create static classes and call 
their methods is pretty much a positive 'side effect').

So, this is the intended behavior.

Previous Comments:

[2001-01-30 13:39:15] [EMAIL PROTECTED]
If you call a static method from within an object, the static method will inherit the 
$this pointer of the calling object. This script demonstrates the problem:



class StaticClass {
    function doSomething() {
        echo $this->data;

class Instantiated {
    var $data;

    function Instantiated($data) {
        $this->data = $data;

$ob = new Instantiated('foo');


This is rather confusing behavior - $this should be out of scope inside static methods 
no matter what.


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found 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