This kind of scoping is why I swore off PHP too. I wrote quite a bit of code thinking I'd figure out how scoping rules worked later (I figured there must be a my I hadn't found out about yet). It turned out, though, that there were only three scopes: global, file, and function. I was horrified. It's been over a year, and I still cringe a little inside as I think about it.
In reply to Re: "When closures capture their context" and "scope gotchas in Javascript"
by kyle
in thread "When closures capture their context" and "scope gotchas in Javascript"
by clinton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |