For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > June 2007 > Re: the global key word









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: the global key word
ZeldorBlat

2007-06-26, 7:02 pm

On Jun 26, 2:21 am, Manny <thebar...@gmail.com> wrote:
> On Jun 25, 5:15 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I left out the rest of the rest of the initialization code for
> brevity. But you're right it would be more appropriate to do that.
> However, it still eludes me why I am not able to import that variable
> using the global operator. I was able to circumvent this by using the
> $GLOBALS array but that in itself is bad practice.
>
> I've changed the code since then to use default initializers in the
> constructor for a default setting, but just out of curiousity and
> pedagogical reasons, why is this happening ?!


It's difficult to say since you haven't (according to you) included
all the code from the constructor.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com