php / pecl-database-ibm_db2

Extension for IBM DB2 Universal Database, IBM Cloudscape, and Apache Derby
http://pecl.php.net/package/ibm_db2
Apache License 2.0
23 stars 27 forks source link

Convert resources to objects #45

Open NattyNarwhal opened 1 year ago

NattyNarwhal commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

See php/php-tasks#6.