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 7516887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:16:35+00:00 2026-05-30T01:16:35+00:00

call_user_func_array() ‘s PHP manual’s examples can only make me more confused with those foo

  • 0

call_user_func_array()‘s PHP manual’s examples can only make me more confused with those foo and bar variables!

Anyway, please consider the _remap and ComplexFunction below:

class MyClass extends CI_Controller
{

    public function _remap($method, $params = array())
    {

        if (method_exists($this, $method))
        {
            return call_user_func_array(array($this, $method), $params);
        }

    }

    public function ComplexFunction($param1, $param2, $param3, $param4)
    {
        // process
        return 'done';
    }

}

Now will this piece of code work correctly?

$params = array(
                'param1' => '1',
                'param2' => '2',
                'param3' => '3',
                'param4' => '4'
               );

$myObject = new MyClass();

$output = call_user_func_array(array($myObject, 'ComplexFunction'), $params);

echo $output;
  1. Will the $output be done?
  2. Is that a reliable method to use in codeigniter’s _remap() function?
  • 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-30T01:16:37+00:00Added an answer on May 30, 2026 at 1:16 am

    This won’t work, as the _remap() function is called by CI’s core functions, and it’s passed a separate argument for each segment in the matched route. You should never have to call the _remap() method yourself!

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

Sidebar

Related Questions

How can I accomplish http://php.net/manual/en/function.call-user-func-array.php in ruby? So I can do this: class App
Is there an equivalent in Python for PHP's call_user_func_array ?
Can PHP call a function and don't wait for it to return? So something
According to the PHP Manual , calling array_map with a NULL callback causes it
I'm trying to make a class which has methods called using PHP's __call() magic
I'm aware of the existence of call_user_func_array, but I don't believe you can use
In PHP 5.3, we can do it in this way. function func() { return
When using call_user_func_array() I want to pass a parameter by reference. How would I
I'm calling a function with call_user_func_array : call_user_func_array(array($this, 'myFunction'), array('param1', 'param2', 'param3')); Everything is
How could I call the constructor of a class with call_user_func_array It is not

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.