In another thread (which I mercifully declined to highjack), someone

> Taken from

And I read this:

Both '$foo =& new StdClass()' and 'function &foo' will now raise an
E_STRICT error.

I don't use this much, but where I do, it's vital. Typically, I use it
to ensure a single copy of the $config for an application, as:

function &get_config() ...


$cfg =& get_config();

If this is going away, how do you return things by reference, so as to
ensure a single copy of something (yes, I know the singleton pattern can
be used; I do use it as well; it's more complicated)?


Paul M. Foster

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to