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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:09:01+00:00 2026-06-09T00:09:01+00:00

When there is inheritance we can do this: class Demo { public function doStuff(Form

  • 0

When there is inheritance we can do this:

class Demo
{    
    public function doStuff(Form $form, Request $request)
    {     
        parent::doStuff($form, $request);
    }

}

Is there a way to inject these same parameter in a funciton that is not a parent, ie:

//...
MyRandomClass::doStuff($form, $request);
//...

If yes, what is the synthax?

Cheers

  • 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-09T00:09:02+00:00Added an answer on June 9, 2026 at 12:09 am
    MyRandomClass::doStuff($form, $request);
    

    will just work (assuming MyRandomClass has been included/required in the context of this line) if the function doStuff() is defined as “public static”.

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

Sidebar

Related Questions

is there any way to do this on a class and still retain the
In my library there's a class like this: class Foo { public: void doSomething();
Is there a way to manage imports of subclasses by inheritance? I know that
I'm using this simple code: http://ejohn.org/blog/simple-javascript-inheritance/ Using this library, I made this simple class:
If you declare an inheritance hierarchy where both the parent and child class have
Suppose I have this code: class A { }; class B: virtual public A
I've something along this lines: public class Something { private IDictionary<object,Activity> fCases; public IDictionary<object,Activity>
My current non-compiling code is similar to this: public abstract class A { }
I know you can do this with inheritance, but you're meant to use inheritance
I don't understand why there is no inheritance in Java annotations, just as Java

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.