Hi,
I'm prototyping a PHP5 extension creates user classes dynamically.
This (mostly) works, although it's apparent that PHP isn't really
expecting this type of activity.
I did encounter problems when trying to build this extension on Windows,
however, because the following functions are not exported from the PHP
DLL:
zend_do_inheritance
zend_initialize_class_data
Are there any objections to exporting these functions so that they can be
used by extensions?
Thanks,
- Mark Spruiell
At 21:30 28/07/2003, Mark Spruiell wrote:
Hi,
I'm prototyping a PHP5 extension creates user classes dynamically.
This (mostly) works, although it's apparent that PHP isn't really
expecting this type of activity.I did encounter problems when trying to build this extension on Windows,
however, because the following functions are not exported from the PHP
DLL:zend_do_inheritance
zend_initialize_class_dataAre there any objections to exporting these functions so that they can be
used by extensions?
Yep, they're internal and shouldn't really be used by extensions - why
doesn't zend_register_internal_class_ex() work for you?
Zeev
At 21:30 28/07/2003, Mark Spruiell wrote:
Hi,
I'm prototyping a PHP5 extension creates user classes dynamically.
This (mostly) works, although it's apparent that PHP isn't really
expecting this type of activity.I did encounter problems when trying to build this extension on Windows,
however, because the following functions are not exported from the PHP
DLL:zend_do_inheritance
zend_initialize_class_dataAre there any objections to exporting these functions so that they can be
used by extensions?Yep, they're internal and shouldn't really be used by extensions - why
doesn't zend_register_internal_class_ex() work for you?
My extension uses these functions to create user classes, not internal
classes - it's essentially translating a specification language into user
classes dynamically. The traditional solution would have been to perform
an intermediate step of translating into PHP code first, but we prefer
this dynamic approach precisely because it avoids the administrative
issues associated with generated code.
- Mark
Hi,
Can I assume from the lack of an enthusiastic response that my
use case doesn't really justify the changes I requested? :)
A couple other questions related strictly to user code, not extensions:
-
I cannot pass null as the value of a parameter for which a type hint
has been specified. Is there any way around this restriction, aside
from removing the type hint? -
Is there a way for a user class to implement the comparison operator?
-
Mark
At 21:30 28/07/2003, Mark Spruiell wrote:
Hi,
I'm prototyping a PHP5 extension creates user classes dynamically.
This (mostly) works, although it's apparent that PHP isn't really
expecting this type of activity.I did encounter problems when trying to build this extension on Windows,
however, because the following functions are not exported from the PHP
DLL:zend_do_inheritance
zend_initialize_class_dataAre there any objections to exporting these functions so that they can
be
used by extensions?Yep, they're internal and shouldn't really be used by extensions - why
doesn't zend_register_internal_class_ex() work for you?My extension uses these functions to create user classes, not internal
classes - it's essentially translating a specification language into user
classes dynamically. The traditional solution would have been to perform
an intermediate step of translating into PHP code first, but we prefer
this dynamic approach precisely because it avoids the administrative
issues associated with generated code.
- Mark