Skip to content
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

Convert resources to objects #45

Open
NattyNarwhal opened this issue Feb 27, 2023 · 2 comments
Open

Convert resources to objects #45

NattyNarwhal opened this issue Feb 27, 2023 · 2 comments

Comments

@NattyNarwhal
Copy link
Member

NattyNarwhal commented Feb 27, 2023

PHP has semi-deprecated resources. They aren't going away, but they aren't recommended anymore, and built-in extensions are being converted.

The main benefit would be being able to use PHP's type system to distinguish between i.e. connections and statements, and declare methods on them (though the old functions would remain for compatibility). I suspect lifetimes would be easier to manage too.

This would be a breaking change for consumers like i.e. the PHP toolkit, that determine if something is ibm_db2 by using resource functions.

@NattyNarwhal
Copy link
Member Author

for future reference, Zend's guide on extensions is pretty good and covers this topic (I think dstogov wrote it?): https://www.zend.com/resources/php-extensions/php-classes-and-objects

@phansys
Copy link
Contributor

phansys commented Mar 5, 2023

See php/php-tasks#6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants