[PHP] Re: Add methods to object dinamically

2004-10-26 Thread Matthew Weier O'Phinney
* Francisco M. Marzoa Alonso [EMAIL PROTECTED]: I've seen that's possible to add members to objects dinamically, in example: class MyClass { private $a; } $MyObject = new MyClass (); $MyObject-b = 1; Now $MyObject has a public member called 'b' that has a value of '1'. The question

[PHP] Re: Add methods to object dinamically

2004-10-26 Thread Greg Beaver
Francisco M. Marzoa Alonso wrote: I've seen that's possible to add members to objects dinamically, in example: class MyClass { private $a; } $MyObject = new MyClass (); $MyObject-b = 1; Now $MyObject has a public member called 'b' that has a value of '1'. The question is, is it possible to

[PHP] Re: Add methods to object dinamically

2004-10-26 Thread Francisco M. Marzoa
Greg Beaver wrote: Sort of :) In PHP5, this will work. [...] Very nice, thanks a lot :-) However, you won't have access to private or protected data members. Damn! that's exactly what I want! :-( It is always better to rigidly define your methods, and extend the class as someone else suggested.

Re: [PHP] Re: Add methods to object dinamically

2004-10-26 Thread Robert Cummings
On Tue, 2004-10-26 at 14:21, Francisco M. Marzoa wrote: Greg Beaver wrote: Sort of :) In PHP5, this will work. [...] Very nice, thanks a lot :-) However, you won't have access to private or protected data members. Damn! that's exactly what I want! :-( It is always