Search found 2 matches

by wizardjoe
Thu Nov 12, 2009 12:52 pm
Forum: PHP - Code
Topic: can a class property be declared using $this?
Replies: 2
Views: 106

Re: can a class property be declared using $this?

So, in your example, when does the property actually get declared? On line 4 with echo $this->name? Or on line 9 with $inst->myString? And is the property called $name or $myString? Finally what's the difference between $this->$name and $this->name, does the first notation produce a property declara...
by wizardjoe
Wed Nov 11, 2009 7:24 pm
Forum: PHP - Code
Topic: can a class property be declared using $this?
Replies: 2
Views: 106

can a class property be declared using $this?

Hi all, I'm working on an open source project and recently came across a piece of code that I found to be ambiguous. The code is a class definition with a constructor that takes one argument, &$db, which is a reference argument to a variable specifying the database connection. The beginning goes...