Jump to content

what does "$var1->$var2" mean?


Derleek

Recommended Posts

That last post was confusing for me too :S sorry cooldude832.

 

But what he was trying to say was:

 

when declaring the variable INSIDE the class (such as):

 

class class1 {

    public $var1 = 1;

    function test () {
        $this->var1 = 10;
        // NOT $var1 = 10;
    }

}

 

But in OUTSIDE use (such as):

 

$newclass = new class1;

$newclass->var1 = 10;
// NOT $var1 = 10

 

Hope that helps :)

 

Daniel

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.