PHP Warning: Parameter expected to be a reference, value given


PHP Warning: Parameter 1 to stats_admin_bar_menu() expected to be a reference, value given

Error type: warning


A warning is displayed even though the function call seems to have the correct number of parameters.

Sample Code:

function stats_admin_bar_menu( &$wp_admin_bar ) {
// …
call_user_func_array(‘stats_admin_bar_menu’, 1);


When a function that has one of the parameters defined as a reference is called with constants, this warning is issued.


Check where parameters are defined as reference and pay attention on what parameters are sent at the function call. If a parameter is defined as a reference, it must receive a variable and not a constant.

Leave a Reply

Your email address will not be published. Required fields are marked *

Security question: * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.