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

  • Home
  • SEARCH
  • 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 8324063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:55:16+00:00 2026-06-08T23:55:16+00:00

I am now trying to create a custom php extension and a problem I

  • 0

I am now trying to create a custom php extension and a problem I am facing is I dont know how to call a parent method.

It is like to be in the class constructor and call the parent’s constructor:

zval *object,
     fname;

object = getThis();
ZVAL_STRING(&fname, "parent::__construct", 0);

if(SUCCESS != call_user_function_ex(NULL, &object, &fname, NULL, 0, NULL, 1, NULL TSRMLS_CC))
{
    RETURN_NULL();
}

How to do this correctly?

  • 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-08T23:55:18+00:00Added an answer on June 8, 2026 at 11:55 pm

    You shouldn’t call the parent’s constructor explicitly if all it does is initialize some of the objects properties. If you do, you’ll end up with nasty things like wrong reference counts and memleaks. For an example, look at how ASTTree extends ASTNodeList.

    The key part there are the zend_object_handlers, for instance create_object_tree. There’s where you should do those things.

    If you want to see how to call other object’s methods, start following the links from the convenience macros in meta_parser.h. obj_call_method_internal_ex() is really reusable. (I’ve put lots of effort into making them that way)

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

Sidebar

Related Questions

I am now trying to create new database manager under Fragment class. But unfortunately,
I'm trying to create a custom tab navigator that has to look like this
I'm trying to create my own custom validator class that I can check the
I'm trying to create a custom ComboBox that behaves like the one in here:
I have got a custom theme with a functions.php, Now I am trying to
I'm stuck! I am trying to create a custom modal dialog. I would like
I'm trying to create a custom view for a spotify playlist. right now I
I am trying to create a custom sort for a vector of class pointers
Right now I am trying to create a producer/consumer thread, the producer thread goes
Right now I'm trying to create my own tiny MVC (just for practice and

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.