PHP C-extension, making use of Late Static Binding

113 Views Asked by At

I'm trying to figure out how to make use of late static binding within a PHP C-extension,

Example, I want to recreate this method:

public final static function create() {
    return new static;
}

How is this possible using the Zend Engine?

EDIT:

I finally got the answer (from http://www.kchodorow.com/blog/2011/08/11/php-extensions-made-eldrich-classes/), within my create method I have this:

zend_class_entry *ce = NULL ;
ce = EG(called_scope);
object_init_ex(return_value, ce);

:) Thanks.

0

There are 0 best solutions below