Re: [PHP] Questions about overloading and visibility in PHP5

2007-09-24 Thread Larry Garfield
On Tuesday 18 September 2007, Andrew Ballard wrote: > > I'm guessing that the answer to all of my questions is some how > > wrapped up in visibility and overloading. Unfortunately I cannot find > > any resource that documents the interactions. TIA. > > As I understand it, the __get and __set do

Re: [PHP] Questions about overloading and visibility in PHP5

2007-09-18 Thread Andrew Ballard
> 1) It seems that the getter and setter are not called on every single > call. For example, if I do the following: > > $bar = new foo; > $bar->x = 'x'; > > There is no output. I would expect to see "Setting $this->x to x." > Another example: > > $bar = new foo; > $bar->y = 'y'; > echo $bar->y; >

[PHP] Questions about overloading and visibility in PHP5

2007-09-18 Thread Steve Brown
I've been doing a bunch of reading about objects and overloading in PHP5, but I've got a couple of questions that I can't seem to find the answer to online. Suppose the following code in PHP5.2.4: $name to $val...\n"; $this->{$name} = $val; } public functi