PHP 5 object scope

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

It doesn't. So, logically speaking then, there wouldn't be block scoping. Heck, PHP doesn't even have blocks. Not that I've ever needed them though...
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Ambush Commander wrote:It doesn't. So, logically speaking then, there wouldn't be block scoping. Heck, PHP doesn't even have blocks. Not that I've ever needed them though...
I'll admit...the useful-ness is rare, but I spend a majority of my time thinking of new ways of solving old problems...

I often push every technology I tinker with to the limits...

In this case...scope blocks would have been something to continue playing with as it might have led to something kinda neat :)

Cheers :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Hockey wrote:
arborint wrote:I don't think block scope is crazy, regardless of its actual usefulnes. It is that you need scope operators like my or our to do that and there aren't any in PHP.
I have never heard of scope operators like *my* or *our*

How would they play a role in what I was trying to do?

I simply needed an object to destruct like what I am accustomed too tis all :)
My and our are used in Perl programming. Typically when you do something like loop over a hash table and you don't need to do anything once the loop is finished. I really must brush up on my perl again... comes in handy sometimes :)
Post Reply