[wp-hackers] call time pass by reference (PHP 5.4 in-compatibilities)

Andrew Nacin wp at andrewnacin.com
Fri Dec 28 23:43:12 UTC 2012


On Fri, Dec 28, 2012 at 6:31 PM, Mike Schinkel <mike at newclarity.net> wrote:

> On Dec 28, 2012, at 5:55 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
> > However, *we can't remove existing instances* of _ref_array() calls
> > without breaking plugins. Plugin callbacks tied to existing _ref_array()
> > actions might be explicitly asking for their value to be passed by
> > reference, like so:
>
> Would we consider adding a constant (with caveat[1]) that is halfway
> between WP_DEBUG=true and WP_DEBUG=false?  One that is set true for new
> sites but false for upgraded sites, a WP_NO_DEPRECATED constant?  This way
> plugin authors would have most of an incentive to fix deprecated usage as
> their plugins would fail for newer sites that don't allow deprecated usage
>

We simply have do_action_ref_array() pass all of its arguments to
do_action()
when WP_DEBUG is on, which would thus trigger E_WARNINGs in the situation
I described and could then be dealt with. It'd be a good start.


More information about the wp-hackers mailing list