Last modified: 2010-05-15 15:38:56 UTC
PHP 5.1 has added even more wacky places where using references causes errors. At least some of these are fixed or worked around on ORACLE_WORK branch. We may want to look at where we actually need to be using references (eg for passing mutable objects in PHP4, and for passing string and array out-parameters in general) and prune the others. A simple page view gives: PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/ObjectCache.php on line 110 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/ObjectCache.php on line 115 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/DatabaseFunctions.php on line 52 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Article.php on line 490 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/BagOStuff.php on line 369 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Database.php on line 1435 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 230 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Database.php on line 1544 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 161 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 51 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/SkinTemplate.php on line 136 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Namespace.php on line 124 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 158 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 75 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Database.php on line 1435 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 230 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Database.php on line 1544 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 161 PHP Notice: Only variable references should be returned by reference in /opt/web/pages/head/includes/Revision.php on line 51 PHP Fatal error: Only variables can be passed by reference in /opt/web/pages/head/includes/SkinTemplate.php on line 542 PHP 4.4.0 gives notices as well, but does not give the fatal error.
(Tested with PHP 5.1.0b3 as CGI on Mac OS X.)
Marking tentatively fixed in CVS HEAD. I haven't exhaustively tested every feature, but so far so good.
FYI Search functionality (or at least SearchMySQL.php line 52) is still broken due to this in 1.5b4 which seems to have been rolled after the fix.
MediaWiki: 1.5rc3 PHP: 5.1.0RC1 (apache2handler) MySQL: 5.0.11-beta-nt Fatal error: Only variables can be passed by reference in C:\Program Files\mediawiki-1.5rc3 \includes\SearchMySQL.php on line 52 Fatal error: Only variables can be passed by reference in C:\Program Files\mediawiki-1.5rc3 \includes\SpecialLog.php on line 166 Fatal error: Only variables can be passed by reference in C:\Program Files\mediawiki-1.5rc3 \includes\SpecialUndelete.php on line 50
Additionally, SkinTemplate was recently broken completely again on PHP 5.1. Should all be fixed in current CVS REL1_5 and HEAD now.
*** Bug 3515 has been marked as a duplicate of this bug. ***
This is still broken for me, in one place. MediaWiki: 1.5.1 PHP: 5.0.5 (apache) MySQL: 4.1.14-standard [29-Oct-2005 15:08:58] PHP Fatal error: Only variables can be passed by reference in /usr/www/mediawiki/includes/Skin.php on line 541 The offending code exists in both REL1_5 and HEAD (albeit on different line numbers in HEAD).
Bit from comment 7 now fixed. (Title::equals took a reference parameter but didn't need to; a bit calling it in newtalk notification for classic skin failed on 5.0.5.)