BC for affected row count (interbase)
| From: | Ard Biesheuvel | Date: | Tue, 25 May 2004 11:44:24 +0000 |
| Subject: | BC for affected row count (interbase) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-10082@lists.php.net to get a copy of this message | ||
Hello,
Recently, I've changed ibase_query() to return the number of affected rows, if appropriate. This works like a charm in all cases except the one where the query is successful but no rows are returned.
Returning int(0) in this case would evaluate to 'false' indicating failure. This would break BC.
Right now I just return bool(true) in this case, which evaluates to int(1) in a numerical context, which is also incorrect. [You'd have to test both the type and the value, like in the 'strpos(...) !== false' case]
I would like to change it to return string('0 ') [with space], as it evaluates to bool(true) in a boolean context and to int(0) in a numeric context.
Any thoughts ?
--
Ard