#37487 [NEW]: oci_fetch_array() array-type should always default to OCI_BOTH

From: Date: Thu, 18 May 2006 04:32:43 +0000
Subject: #37487 [NEW]: oci_fetch_array() array-type should always default to OCI_BOTH
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97299@lists.php.net to get a copy of this message
From: cjbj at hotmail dot com Operating system: n/a PHP version: 5.1.4 PHP Bug Type: OCI8 related Bug description: oci_fetch_array() array-type should always default to OCI_BOTH Description: ------------ The array type for oci_fetch_array() should always default to OCI_BOTH unless explicitly changed. For example, currently oci_fetch_array($s) is equivalent to oci_fetch_array($s, OCI_BOTH) I'm saying that oci_fetch_array($s, OCI_RETURN_NULLS) should be equivalent to oci_fetch_array($s, OCI_RETURN_NULLS+OCI_BOTH) At the moment it is equivalent to oci_fetch_array($s, OCI_RETURN_NULLS+OCI_NUM) which is (i) not documented (ii) harder to understand and document. Reproduce code: --------------- <?php $c = oci_connect("hr", "hr", "//localhost/XE"); $s = oci_parse($c, "select * from dual"); oci_execute($s); while ($res = oci_fetch_array($s, OCI_RETURN_NULLS)) { echo "<pre>"; var_dump($res); echo "</pre>"; } oci_execute($s); while ($res = oci_fetch_array($s)) { echo "<pre>"; var_dump($res); echo "</pre>"; } oci_close($c); ?> Expected result: ---------------- array(2) { [0]=> string(1) "X" ["DUMMY"]=> string(1) "X" } array(2) { [0]=> string(1) "X" ["DUMMY"]=> string(1) "X" } Actual result: -------------- array(1) { [0]=> string(1) "X" } array(2) { [0]=> string(1) "X" ["DUMMY"]=> string(1) "X" } -- Edit bug report at http://bugs.php.net/?id=37487&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37487&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37487&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37487&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37487&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37487&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37487&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37487&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37487&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37487&r=support Expected behavior: http://bugs.php.net/fix.php?id=37487&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37487&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37487&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37487&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37487&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37487&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37487&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37487&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37487&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37487&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37487&r=mysqlcfg

« previous php.bugs (#97299) next »