Last modified: 2010-05-15 15:33:23 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 T2992, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 992 - Fatal errors with recent changes on PHP5
Fatal errors with recent changes on PHP5
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: 202
  Show dependency treegraph
Reported: 2004-12-03 21:38 UTC by Sharif Ibrahim
Modified: 2010-05-15 15:33 UTC (History)
0 users

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


Description Sharif Ibrahim 2004-12-03 21:38:01 UTC
Generating the recent changes page on PHP 5.0.3RC1 (problem also occurred on
5.0.1 before upgrading) generates errors of the form:

Fatal error: Only variables can be passed by reference in
/path/to/wiki/includes/ChangesList.php on line 494

It appears that makeKnownLinkObj accepts a reference as its first argument
(&$nt) but lines 494, 495 and 503 of ChangesList.php pass in $rc->getTitle()
which is not a variable.

Possible ways to fix:
* Change makeKnownLinkObj to not use an explicit reference. PHP 5 will pass by
reference automatically but this would cause PHP4 to make a copy of the object.
 This inconsistency may preclude this as a solution.

* Assign $rc->getTitle() to a local variable and pass this instead.

PHP5 Workaround:  Setting the zend.ze1_compatibility_mode flag emulates much of
PHP4's object behavior and thus no error is emitted.
Comment 1 Brion Vibber 2004-12-03 22:00:16 UTC
makeKnownLinkObj had used a reference before, so it probably makes the 
most sense to use variables in the ChangesList code (which I relatively 
recently switched from using text to objects, giving a huge performance 
boost to Recentchanges rendering).

It's silly to call the getTitle() function over and over, anyway.
Comment 2 Zigger 2004-12-04 02:10:28 UTC
Recentchanges works for me with php v5.0.0 under Windows 2000 and 
zend.ze1_compatibility_mode = Off
Comment 3 Brion Vibber 2004-12-04 05:49:24 UTC
Works for me with PHP 5.0.3RC1 [compiled from source on Linux], stock configuration 
(zend.ze1_compatibility_mode = Off according to phpinfo()).

It might be triggered by some particular conditions or configuration options; can you narrow it 
Comment 4 Brion Vibber 2004-12-04 18:28:23 UTC
Found it, it's only Enhanced Recent Changes mode that has this problem. Will fix.
Comment 5 Brion Vibber 2004-12-04 19:00:33 UTC
Fixed by returning a reference from RecentChange::getTitle()

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