# BC for affected row count (interbase)

- Thread: https://externals.io/message/10082
- Original archive: https://news-web.php.net/php.internals/10082
- Started by Ard Biesheuvel on 2004-05-25T11:44:24+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #10082 — Ard Biesheuvel — 2004-05-25T11:44:24+00:00

URL: https://externals.io/message/10082#10082

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
