PHP 5 object scope
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
I'll admit...the useful-ness is rare, but I spend a majority of my time thinking of new ways of solving old problems...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 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
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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 sometimesHockey wrote:I have never heard of scope operators like *my* or *our*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.
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