RE: [PEAR-DEV] db abstraction: pass by reference versus return
| From: | Lukas Smith | Date: | Fri, 12 Jul 2002 09:52:18 +0000 |
| Subject: | RE: [PEAR-DEV] db abstraction: pass by reference versus return | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7682@lists.php.net to get a copy of this message | ||
> IMO, inconsistency comes when you don't know what the method you call
will
> return. It has always been weird for me to think that a DB result
object
> could end up being a BD error object. I think 1) is more intuitive
because
> we know what the result will be and also because it is a lighter
solution
> when there are no errors.
>
> So +1 for 1)
>
would you also say that methods that handel conversion should be handled
this way?
For example:
$query = 'SELECT * from foo WHERE bar = '.getTextValue($bar);
would then not work and instead something like this:
getTextValue($bar, $bar_quoted);
$query = 'SELECT * from foo WHERE bar = '.$bar_quoted;
would be needed.
Best regards,
Lukas