Page 1 of 1

Overriding mysqli_stmt::bind_result

Posted: Tue Aug 25, 2009 6:37 pm
by ChrisOdd
I'm trying to create a new subclass of mysqli_stmt (for the purposes of doing some standardized error checking), and am trying to override the bind_result method.

I've been having difficulty with how to declare this override method:

Code: Select all

 
<?php
class MyErrorCheckingSqliStmt extends mysqli_stmt
{
  public function bind_result([a])
  {
     //My standardized error checking omitted 
 
     $bool = parent::bind_result([b]);
     return $bool;
  }
}
?>
 
What should I replace [a] and with to make this work?

Re: Overriding mysqli_stmt::bind_result

Posted: Tue Aug 25, 2009 10:13 pm
by requinix
Not too sure you can. The arguments have to be by-reference and func_get_args doesn't support that.


...Well, you can. Kinda. But it's a bug/feature in PHP that could suddenly disappear so relying on it is a bad idea.