PHP6 return by reference deprecation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> Taken from http://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html

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() ...

and/or:

$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

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux