xref: /PHP-8.3/ext/oci8/tests/bug36096.phpt (revision a53e5617)
1--TEST--
2Bug #36096 (oci_result() returns garbage after oci_fetch() failed)
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11
12require __DIR__."/connect.inc";
13
14$sql = "SELECT 'ABC' FROM DUAL WHERE 1<>1";
15$stmt = oci_parse($c, $sql);
16
17if(oci_execute($stmt, OCI_COMMIT_ON_SUCCESS)){
18    var_dump(oci_fetch($stmt));
19    var_dump(oci_result($stmt, 1));
20    var_dump(oci_field_name($stmt, 1));
21    var_dump(oci_field_type($stmt, 1));
22}
23
24echo "Done\n";
25
26?>
27--EXPECTF--
28bool(false)
29bool(false)
30string(%r[53]%r) "%r('ABC'|EXP)%r"
31string(4) "CHAR"
32Done
33