Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7613349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:08:02+00:00 2026-05-31T02:08:02+00:00

call_user_func(‘array_pop’, $myarray); gives ‘Parameter 1 to array_pop() expected to be a reference, value given’,

  • 0
call_user_func('array_pop', $myarray);

gives ‘Parameter 1 to array_pop() expected to be a reference, value given’, while

call_user_func('array_pop', &$myarray);

gives ‘Call-time pass-by-reference has been deprecated’.

So what am I supposed to do? I am on “PHP Version 5.3.5” on Windows, and turning of deprecated warnings isn’t an option.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:08:03+00:00Added an answer on May 31, 2026 at 2:08 am

    Either just call it directly:

    array_pop($myarray);
    

    Or use call_user_func_array(), which accepts an array of references as parameters without yelling at you about call-time pass-by-reference:

    call_user_func_array('array_pop', array(&$myarray));
    

    The reason this doesn’t raise a warning about call-time pass-by-reference is because nothing of that sort actually happens. There is a subtle difference between passing a variable by reference and creating an array of references and passing that array by value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using call_user_func_array() I want to pass a parameter by reference. How would I
Is there any difference between: $callback = array(&$this, 'method'); $callback[0]->$callback[1]($args); and call_user_func(array(&$this, 'method'), $args);
Given the following method: public function foo($callback) { call_user_func($callback); } How would I test
I'm trying to use call_user_func to call a method from another method of the
It fires out when I try to call function with argument by reference function
When I use call_user_func on a non-static method in PHP 5.2 I get a
Does python have a function like call_user_func() in PHP? PHP Version: call_user_func(array($object,$methodName),$parameters) How do
How could I call the constructor of a class with call_user_func_array It is not
I'm wondering if there is an equivalent function to PHP's call_user_func() in ASP.NET application.
If I call user.ChangePassword(oldpass,newpass), and the old password is wrong, or the new password

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.