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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:30:22+00:00 2026-06-17T17:30:22+00:00

SO question Weird behaviour with triggering __callStatic() from non-static method is great because it

  • 0

SO question Weird behaviour with triggering __callStatic() from non-static method is great because it explains the weird behaviour with the __callStatic not being called from within the class itself (Note that I don’t see this behaviour in 5.3.3 but in 5.3.8 and 5.3.12). It seems that the __callStatic can only be invoked from outside the class. That’s now a fact. But what do I do if I really want the __callStatic to be called from within my class? What syntax should I use to get over the issue?

  • 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-17T17:30:23+00:00Added an answer on June 17, 2026 at 5:30 pm

    It does not have to be from outside the class, just not from object context (i.e. where $this is an instance of the class). So you can wrap this call in a static method, for example:

    class TestCallStatic
    {
        public function __call($func, $args)
        {
            echo "__call($func)";
        }
    
        public static function __callStatic($func, $args)
        {
            echo "__callStatic($func)";
        }
    
        public function test()
        {
            self::_test();
        }
        protected static function _test()
        {
            self::i_am_static();
        }
    }
    
    $test = new TestCallStatic();
    $test->test();
    

    Output:

    __callStatic(i_am_static)

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

Sidebar

Related Questions

Lately I've been seeing some weird behaviour when accessing YouTube from my laptop. For
Weird question, but one that puzzles me a bit. In the old days when
Weird question, but i need to find an answer. Is there any way, in
Weird question this, going round in circles. I have 2 pages. Page 1. Has
got a weird question for you based on some weird happenings on our site.
I have a weird question. After profiling my code several times with NYTProf. I
This is a weird question but its been driving me bonkers for the last
this is a long question and weird problem that I hope to solve. My
This is kind of a weird question so my title is just as weird.
This might seem like a weird question, but bear with me. I'd like to

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.