PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #3906

get*() should return an empty array instead of NULL

Details

Request #3906get*() should return an empty array instead of NULL
Submitted2005-03-21 22:50 UTC
Frominfo at peter-thomassen dot de
Assigneddanielc
StatusBogus
PackageDB
PHP Version5.0.3
OSLinux
Roadmaps(Not assigned)

Comments

[2005-03-21 22:50 UTC] info at peter-thomassen dot de

Description:
------------
When iterating through a resultset with foreach(), a PHP
warning is triggered if the resultset is empty, i.e. NULL.
This could be prevented by returning an empty array in
this case.

[2005-03-23 20:27 UTC] info at peter-thomassen dot de

Sorry, the DB functions work fine. I had a problem with
foreach($array) with $array being NULL. I thought that NULL
had been returned by a get*() function of DB because no
rows were returned by the DBMS, but I had modified the
array.

Sorry again, closing.