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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:48:32+00:00 2026-06-04T00:48:32+00:00

The title is a bit confusing, I know, but it’s the best I could

  • 0

The title is a bit confusing, I know, but it’s the best I could do. =P

Hopefully, someone will be able to help.

I’m using CodeIgniter and I have a method in a base class that has multiple parameters:

class MY_Base extends CI_Model {

    function some_function($param1, $param2 ... $param8) {
        // do stuff
    }
}

What I want to do is basically this, in a child class:

class Child extends MY_Base {

    function some_function($param1, $param2 ... $param8) {
        parent::some_function($param1, $param2 ... $param8);
        // call a methods found in this class only
        $this->some_method();
    }

    function some_method() {
        // do more stuff
    }
}

I can’t touch the base classes so I have to extend from it. Problem is, There are just too many parameters. And this happens in different methods as well and sometimes I forget one which makes the code fail.

So I was wondering, if there’s a way to write it like this:

function some_function(__PARAMETERS__) {
    parent::some_function(__PARAMETERS__)
}

I seem to vaguely recall that this is possible but I can’t find it in Google. Probably because I’m searching the wrong keywords.

Any help would be appreciated.

EDIT:
And then, of course, I find func_get_args() after posting this question.
This seems to do what I want, but I’ll leave this question up for better ideas.

  • 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-06-04T00:48:33+00:00Added an answer on June 4, 2026 at 12:48 am
    function some_function($a, $b, $c) {
        call_user_func_array('parent::some_function', func_get_args());
    }
    

    WARNING: PHP >= 5.3

    or even:

    function some_function($a, $b, $c) {
        call_user_func_array('parent::' . __FUNCTION__, func_get_args());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title is a bit wonky but it's the best I could come up
I know the title of this question is a bit confusing, but here it
OK, the title is a bit(lot) cryptic, but that's the best one-line-summary I could
Ok I know the title is a bit confusing but here is my problem:
So I know I butchered the title a bit but if someone looks here
The title is a bit confusing I know but I wasnt quite sure how
I know title is a bit confusing ;D but basically what I want to
I'll admit the title is a bit confusing but it was hard to come
Ok, the title is a bit confusing, but here's my predicament. I've made a
The title is a bit long, but it should be pretty straightforward for someone

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.