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