#3218 closed defect (bug) (no action required)
patch for removing a few call-time pass-by-reference warnings
Reported by: | hran | Owned by: | |
---|---|---|---|
Milestone: | 1.2.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: |
Description
Call-time pass-by-reference is deprecated in PHP 5.3, but actually is deprecated in many hosts prior to PHP 5.3, who setting allow_call_time_pass_reference to false. The PHP developers recommend that all developers move away from this usage pattern (see http://php.net/manual/en/ini.core.php, under "allow_call_time_pass_reference").
I've attached a patch for bp-groups-classes.php. There are many other parts of BP where this occurs. To fix each occurrence, however, we need to first verify that removing the pass-by-reference wouldn't have undesirable side effects (i.e. prevent a required modification to a variable). So far, however, it looks like many of the pass-by-references don't actually modify the passed variables.
If you're open to it, I can work on this some more.
As a related issue I would recommend turning on WP_DEBUG and noting the other notices. Each notice in PHP incurs a performance cost even if it isn't logged.
Thanks for the patch. I see it was built against the branch (1.2.8) version; our current development trunk, I think, has already addressed most of these. I've looked at these specific ones and they look like they've been corrected in trunk already. Likewise, the PHP notices have been cleared.
Are you up for taking a look at trunk (http://svn.buddypress.org/trunk/) and seeing if you can spot anything missed? Thanks