Replacing mysqli's Connection, Result and Statement classes
Note: This article was originally published at Planet PHP
on 7 July 2010.
Have you ever though about extending mysqli's classes. It's pretty simple to subclass the connection class mysqli. However, subclassing mysqli_result and mysqli_stmt is not so obvious, actually I though that it's even not possible.
However, never say never! After discussing mysqli's OO interface for an hour yesterday, with Johannes and Ulf, and breaking two tests of mysqli - 062.phpt and 063.phpt, because I tried to final-ize mysqli_result and mysqli_stmt, as well as make their constructors private, I found out how one can plug his own classes.


