Hi again!
Now that namespaces seem to be on their way into PHP 6 I wonder if
let-blocks, as in JavaScript 1.7+, ever has been considered for PHP, to
hide global variables from each other?
If so, can someone point me to the discussion?
For those that might have missed JS 1.7:
http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Block_scope_with_let
Lars Gunther
Now that namespaces seem to be on their way into PHP 6 I wonder if
let-blocks, as in JavaScript 1.7+, ever has been considered for PHP, to
hide global variables from each other?
I personally am not convinced that PHP has any need for convoluted
scoping rules that "let" creates. What would be a use case that would
require such function?
--
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com
I don't get the point of it. IMO this will only add another level of
confusion to sourcecode; unless someone has a real good example (better
than those in the posted link) where this technique is required I cannot
see which benefit this feature adds.
regards
danielj
Keryx Web wrote:
Hi again!
Now that namespaces seem to be on their way into PHP 6 I wonder if
let-blocks, as in JavaScript 1.7+, ever has been considered for PHP, to
hide global variables from each other?If so, can someone point me to the discussion?
For those that might have missed JS 1.7:
http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Block_scope_with_letLars Gunther