Sean Coates wrote:
Ilya Sher wrote:

We discussed this issue with Jevon Wright (private emails)
and in the end of the day agreed that most simple yet powerful
solution is "superglobals", which would work like $_GET,$_POST
etc.


This can be accomplished in user-space, by cheating the existing $_* superglobals (if you must -- cowiki does this, IIRC):

<?php

$_SERVER['foo'] = array('bar', 'baz');

function oink()
{
  print_r($_SERVER['foo']);
}

oink();

?>

S


That is one more word (to type) to access the variable, each time. If you acces a variable more than once in the function you would probably like to declare it global (the usual way). Or even extact($GLOBALS['my_globs']); which would be a hash of all globals one usually needs.

I don't see much of advantage here.
The most frustrating case would be one usage of a
global per function. "superglobals" would save a lot
of typing. The suggested method wouldn't.

This discussion is theoretical anyway because Andi
already said "no" ...

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



Reply via email to