Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
> You are correct as there was no metaphor in here at all!  This, "It > helps to think of classes like cars on a highway", is almost a simile, > but on the whole I would probably say that you were using an analogy :-) > HEIL SPELLCHECK! I bow to my grammar nazi superior *bow* -- PHP General Mai

Re: [PHP] Re: Scope woe

2009-06-30 Thread Shawn McKenzie
Eddie Drapkin wrote: > On Tue, Jun 30, 2009 at 10:44 AM, Luke wrote: > > What I meant, and I probably sounded a bit rougher than I absolutely > had to, was that it's pretty universally lazy and/or bad design to use > global variables inside a class, because classes have member > properties. From

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 12:37 PM, Paul M Foster wrote: > On Tue, Jun 30, 2009 at 11:17:17AM -0400, Eddie Drapkin wrote: > > > >> >> I wouldn't really recommend going with a singleton in this situation, >> as there exists a different solution (my other post :P) and there are >> very few actual use-

Re: [PHP] Re: Scope woe

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 11:17:17AM -0400, Eddie Drapkin wrote: > > I wouldn't really recommend going with a singleton in this situation, > as there exists a different solution (my other post :P) and there are > very few actual use-cases where the pattern makes sense, and deploying > it unnecess

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 11:12 AM, Peter Ford wrote: > Luke wrote: >>> >> Thanks for the replies :) >> >> Surely if I pass it as a parameter to the __construct then I would have to >> make an instance of the otherObject, notice that messwithotherthings is >> static? >> >> Also, if I'm not using OOP

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 10:44 AM, Luke wrote: > > > 2009/6/30 Eddie Drapkin >> >> It should be passed into the constructor as a parameter.  If you're >> using OOP properly, there's no reason to use $GLOBALS, ever.  Any >> variable in the $GLOBALS array exists twice in memory, so just keep >> tha

Re: [PHP] Re: Scope woe

2009-06-30 Thread Peter Ford
Luke wrote: >> > Thanks for the replies :) > > Surely if I pass it as a parameter to the __construct then I would have to > make an instance of the otherObject, notice that messwithotherthings is > static? > > Also, if I'm not using OOP properly, Eddie, how would I use it properly to > prevent th

Re: [PHP] Re: Scope woe

2009-06-30 Thread Luke
2009/6/30 Eddie Drapkin > It should be passed into the constructor as a parameter. If you're > using OOP properly, there's no reason to use $GLOBALS, ever. Any > variable in the $GLOBALS array exists twice in memory, so just keep > that in mind, if you plan to use it. > > On Tue, Jun 30, 2009 a

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
It should be passed into the constructor as a parameter. If you're using OOP properly, there's no reason to use $GLOBALS, ever. Any variable in the $GLOBALS array exists twice in memory, so just keep that in mind, if you plan to use it. On Tue, Jun 30, 2009 at 8:43 AM, Peter Ford wrote: > Luke w

[PHP] Re: Scope woe

2009-06-30 Thread Peter Ford
Luke wrote: > Hello again guys, > > I was wondering the best way to tackle the following problem: > > I've got a class, containing a property which is another object. So from > outside I should be able to do > $firstobject->propertycontainingobject->methodinsidethatobject(); > > The $firstobject

[PHP] Re: Scope woe

2009-06-30 Thread Jo�o C�ndido de Souza Neto
I think the best way is passing the object instance as a parameter to the messwithotherthings method. -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636 - JS www.siens.com.br "Luke" escreveu na mensagem news:17aa29670906300114t5b95c12dk9dfdfbdfdd7