Last modified: 2010-05-15 15:33:23 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.
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.
Recentchanges works for me with php v5.0.0 under Windows 2000 and
zend.ze1_compatibility_mode = Off
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
Found it, it's only Enhanced Recent Changes mode that has this problem. Will fix.
Fixed by returning a reference from RecentChange::getTitle()