If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

PHP stdClass

I have a large class. The $this internal variable seems to be getting clobbered somewhere. On one line an echo "this->id=$this->id" works perfectly. The next line is a conditional statement and if that 'echo' line is inserted there it tells me that 'id' is an unknown property. Example:

So, if you are still having a problem, we probably need to see the exact code you are using that results in this error (preferably reduced to the shortest, simplest code you can find that generates the error).

That's the problem, it's a BIG class and I don't know how to reproduce it. This class (emailClass) extends a docTemplate class which in turn utilizes a varInfo class which uses several classes (orderClass, orderItemClass, itemOptionClass, inventoryClass, invSupplierClass, etc....)

This just came up and I'm not sure why. I've had lots of run time on all of this without problems. All I know is that if I put the debugging output on one line (ahead of an if( isset(...) )) it's fine, but if I put it below the if() it fails...

Makes absolutely no sense to me... Note that most all of the classes utilize a globalObjectClass which returns a reference to a common object. I.e. I do
$Aobj =& newGlobalObject("Aclass.php"); and then maybe in a different function I do the same thing. It allows me to keep the class context rather than having separate instances of those classes.