Boerger [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, October 29, 2005 3:58 AM
>> To: Bob Silva
>> Cc: internals@lists.php.net
>> Subject: Re: [PHP-DEV] Follow the object constructor chain ... options
>>
>> Hello Bob,
>>
>> why so complex and pote
> Sent: Saturday, October 29, 2005 3:58 AM
> To: Bob Silva
> Cc: internals@lists.php.net
> Subject: Re: [PHP-DEV] Follow the object constructor chain ... options
>
> Hello Bob,
>
> why so complex and potential wrong?
>
> zend_class_entry *ce = Z_OBJ_CE(object);
>
Hello Bob,
why so complex and potential wrong?
zend_class_entry *ce = Z_OBJ_CE(object);
zend_function*ctor = ce->parent ? ce->parent->constructor : NULL;
if (ctor && ctor->common.fn_flags & ZEND_ACC_PUBLIC) {
zend_call_method_with_0_params(object, ce, ctor, "__construct", NULL);
}
btw,
I believe I have it working. Anyone see any blatant problems with this?
Also, would it make sense to have this functionality in the engine itself?
Seeing as that internal classes have inheritance capabilities, it seems
logical to have the functionality to call a parent constructor within the
engine