Last modified: 2010-05-15 15:38:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T4885, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 2885 - PHP 5.1 fatal errors caused by reference passing
PHP 5.1 fatal errors caused by reference passing
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.5.x
All All
: Normal blocker with 1 vote (vote)
: ---
Assigned To: Brion Vibber
:
: 3515 (view as bug list)
Depends on:
Blocks: code_quality 2884 2931
  Show dependency treegraph
 
Reported: 2005-07-17 04:27 UTC by Brion Vibber
Modified: 2010-05-15 15:38 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2005-07-17 04:27:03 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.
Comment 1 Brion Vibber 2005-07-17 04:28:04 UTC
(Tested with PHP 5.1.0b3 as CGI on Mac OS X.)
Comment 2 Brion Vibber 2005-07-22 12:56:01 UTC
Marking tentatively fixed in CVS HEAD.

I haven't exhaustively tested every feature, but so far so good.
Comment 3 Richard A Steenbergen 2005-08-19 22:13:03 UTC
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.
Comment 4 Kit Patterson 2005-08-28 21:17:29 UTC
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
Comment 5 Brion Vibber 2005-08-28 21:59:56 UTC
Additionally, SkinTemplate was recently broken completely again on PHP 5.1.

Should all be fixed in current CVS REL1_5 and HEAD now.
Comment 6 Brion Vibber 2005-09-20 08:53:27 UTC
*** Bug 3515 has been marked as a duplicate of this bug. ***
Comment 7 Dave Barr 2005-10-29 23:48:58 UTC
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).
Comment 8 Brion Vibber 2005-10-30 01:31:32 UTC
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.)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links