Last modified: 2012-12-24 04:09:33 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 T43671, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41671 - PHP Deprecation: Assigning by reference ("=&") should be removed
PHP Deprecation: Assigning by reference ("=&") should be removed
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.21.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: newphp
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2012-11-02 03:04 UTC by Yaron Koren
Modified: 2012-12-24 04:09 UTC (History)
4 users (show)

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


Attachments

Description Yaron Koren 2012-11-02 03:04:13 UTC
There are lots of places in the code where variables are assigned using "=&" - a quick search shows that there may be around 100 such lines. As far as I know, this is deprecated in PHP 5.3, and now that 5.3.2+ is required, this seem like a good time to fix all of these assignments.
Comment 1 Krinkle 2012-11-02 03:19:35 UTC
Exact warning (for search):

 PHP Deprecated:  Assigning the return value of new by reference is deprecated

Info: http://www.php.net/manual/en/oop4.newref.php
Comment 2 Karun 2012-12-19 12:44:29 UTC
(In reply to comment #0)
> There are lots of places in the code where variables are assigned using "=&"
> -
> a quick search shows that there may be around 100 such lines. As far as I
> know,
> this is deprecated in PHP 5.3, and now that 5.3.2+ is required, this seem
> like
> a good time to fix all of these assignments.

I don't see from the page anything about it saying =& is deprecated, on the info page for php5

Info: http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.new

it still shows examples with =&, and neither the page in comment 1 or here, mentions anything about it.
Comment 3 Jarry1250 2012-12-19 12:52:16 UTC
I assume we're talking about "=& new " notation here?
Comment 4 Karun 2012-12-19 12:53:42 UTC
(In reply to comment #3)
> I assume we're talking about "=& new " notation here?

The original comment just says =& which is not deprecated, so I would assume not, unless the comment is missing this.
Comment 5 Jarry1250 2012-12-19 13:03:09 UTC
In fairness "=& new" doesn't appear in the MediaWiki codebase AFAICT, so if it is just that that is deprecated (as comment #1 suggests), we should probably close this as INVALID.
Comment 6 Karun 2012-12-19 13:04:41 UTC
(In reply to comment #5)
> In fairness "=& new" doesn't appear in the MediaWiki codebase AFAICT, so if
> it
> is just that that is deprecated (as comment #1 suggests), we should probably
> close this as INVALID.

Yes agree. =& is not deprecated, and its unclear if the search results are from just searching for =& or =& new. A new bug should be opened for =& new if this is the problem.
Comment 7 Krinkle 2012-12-24 04:09:33 UTC
(In reply to comment #1)
> Exact warning (for search):
> 
>  PHP Deprecated:  Assigning the return value of new by reference is
> deprecated
> 
> Info: http://www.php.net/manual/en/oop4.newref.php

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


Navigation
Links