[Wylug-help] PHP equiv of my or local variable

mikeb@gbdirect.co.uk mikeb at gbdirect.co.uk
Thu, 23 Jan 2003 00:56:55 +0000


On Wed, Jan 22, 2003 at 11:58:52AM -0500, Smylers@stripey.com wrote:
> On Wed, 22 Jan 2003, Gary Stainburn wrote:
>
> > is it possible to have local variables within blocks in php, as you
> > can with perl?
>
> No.  That's something that PHP simplified out, presumably to make laerning
> PHP easier.
>

Etc. etc. The only real model that PHP has for namespaces is objects, which
allow you to hide local variables inside them. It probably doesn't do what Gary
wants particularly but is really the only show in town if you want some kind
of module structure, hence its popularity with package-builders. Since the whole
shooting match takes fifteen minutes to learn from pretty much top to bottom
it can hardly be accused of being over complex, though the documentation that exists
isn't exactly copious if my memory serves me well.

Mike
--
Mike Banahan - GBdirect - Tel 0870 200 7273
Put some reality back into cyberspace! http://somewherenear.com