Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#21839 closed enhancement (fixed)

Audit use of return-by-reference

Reported by: wonderboymusic's profile wonderboymusic Owned by: ryan's profile ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.4.1
Component: Performance Keywords: has-patch
Focuses: Cc:

Description

(The component for this ticket is Performance because nothing else made any sense)

This has come up in other tickets, and each time it has been recommended that we remove the return by reference indicators when present on functions and class methods. From php.net:

Do not use return-by-reference to increase performance. The engine will automatically optimize this on its own. Only return references when you have a valid technical reason to do so.

Is there a valid technical reason to still do so? Since PHP5, objects are always passed by reference.

Attachments (3)

return-by-ref-audit.diff (8.2 KB) - added by wonderboymusic 12 years ago.
21839.i18n.png (67.0 KB) - added by SergeyBiryukov 12 years ago.
21839.mo.diff (542 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (8)

#1 @ryan
12 years ago

  • Milestone changed from Awaiting Review to 3.5
  • Version set to 3.4.1

#2 @ryan
12 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [21792]:

Remove unnecessary return by refs. Props wonderboymusic. fixes #21839

#3 @SergeyBiryukov
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

[21792] totally broke i18n: 21839.i18n.png. 21839.mo.diff fixes that.

#4 @wonderboymusic
12 years ago

eek, sorry bout that

#5 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In [21793]:

Restore return by ref for make_entry(). Props SergeyBiryukov. fixes #21839

Note: See TracTickets for help on using tickets.