Larry Garfield escreveu:
 > Totally silly idea:

function foo($a, $b, &$c) global ($d, &$e) {
  // ...
}

$myfunc = lambda($a, $b, &$c) lexical ($d, &$e) {
  // ...
}

That puts all the information in the declaration line with parallel syntax and 
semantics, and would even allow both by-val and by-ref usage for both lexical 
and global values.  The following would then be exactly equivalent 
functionality-wise:

function foo() global (&$a) {
  // ...
}

function foo() {
  global $a;
  // ...
}

Is that too crazy an idea?

--Larry Garfield

I think allowing globals/lexicals to be passed by value doesn't make much sense, you could just use a regular parameter for that. And that would bring another inconsistency to PHP, and would mean that PHP is discouraging the use of $_GLOBALS, that was created to discourage to use of 'global $var'.

--Rodrigo Saboya

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to