-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make class_alias() work with internal classes #9826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've run into this as well. I think from a technical perspective, the main complication is that a) we can't increment the refcount of an internal class during a request and b) we will have an internal class appear in the region for userland classes in the class table. Class aliases already use a special flag in the class table to distinguish them, so it would be possible to not increment the refcount and skip the aliases entirely for destruction purposes. |
We can't increase the refcount of internal classes during request time. We fix this issue by not increasing refcount for internal classes upon creating an alias and taking this into account during the destruction.
We can't increase the refcount of internal classes during request time. We fix this issue by not increasing refcount for internal classes upon creating an alias and taking this into account during the destruction. To differentiate between the lifetimes, a new IS_INTERNAL_CLASS_REQUEST_ALIAS_PTR internal type is added.
We can't increase the refcount of internal classes during request time. We fix this issue by not increasing refcount for internal classes upon creating an alias and taking this into account during the destruction. To differentiate between the lifetimes, a new IS_INTERNAL_CLASS_REQUEST_ALIAS_PTR internal type is added.
We can't increase the refcount of internal classes during request time. To work around this problem we simply don't refcount aliases anymore and add a check in the destruction to skip aliases entirely. There were also some checks which checked for an alias implicitly by comparing the refcount, these have been replaced by checking the type of the zval instead.
We can't increase the refcount of internal classes during request time. To work around this problem we simply don't refcount aliases anymore and add a check in the destruction to skip aliases entirely. There were also some checks which checked for an alias implicitly by comparing the refcount, these have been replaced by checking the type of the zval instead.
We can't increase the refcount of internal classes during request time. To work around this problem we simply don't refcount aliases anymore and add a check in the destruction to skip aliases entirely. There were also some checks which checked for an alias implicitly by comparing the refcount, these have been replaced by checking the type of the zval instead.
We can't increase the refcount of internal classes during request time. To work around this problem we simply don't refcount aliases anymore and add a check in the destruction to skip aliases entirely. There were also some checks which checked for an alias implicitly by comparing the refcount, these have been replaced by checking the type of the zval instead.
We can't increase the refcount of internal classes during request time. To work around this problem we simply don't refcount aliases anymore and add a check in the destruction to skip aliases entirely. There were also some checks which checked for an alias implicitly by comparing the refcount, these have been replaced by checking the type of the zval instead.
) We can't increase the refcount of internal classes during request time. To work around this problem we simply don't refcount aliases anymore and add a check in the destruction to skip aliases entirely. There were also some checks which checked for an alias implicitly by comparing the refcount, these have been replaced by checking the type of the zval instead.
Description
I was reminded today that
class_alias()
doesn't work with internal classes.I have a use case where a class can be defined either by userland or by an optional extension, and I'd ideally need to alias it. Right now, I have to create a proxy class instead of an alias, and proxy classes are tedious to write+maintain.
Could this limitation be removed?
The text was updated successfully, but these errors were encountered: