|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-18 13:21 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
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" }