#16752 closed enhancement (wontfix)
Remove unnecessary return by reference
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | normal | Version: | |
Component: | General | Keywords: | php5 has-patch needs-testing |
Focuses: | Cc: |
Description
There are several functions in WP that return an object by reference.
With PHP5, this is not necessary anymore.
Examples of such functions: get_post(), get_term().
Attachments (3)
Change History (10)
#2
@
14 years ago
16752.patch as an example. This private function did return by reference, but the callee never received as reference. That's fixed.
The patch additionally shows that it's now possible to call object methods on function returns.
#3
@
14 years ago
- Cc joachim.kudish@… added
- Keywords has-patch needs-testing added; needs-patch removed
Note: See
TracTickets for help on using
tickets.
I don't know how much the trade-off is for that, but the PHP manual says the following:
I think in PHP 4 code it was returned by reference for memory reasons. We should not do that any longer because we don't need it.
Related: #16661, #16813, #16917