summaryrefslogtreecommitdiff
path: root/ext/oci8/tests/bug38161.phpt
blob: 0664510146e00bc60b5a9e33417248e08a2d67de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--TEST--
Bug #38161 (oci_bind_by_name() returns garbage when Oracle didn't set the variable)
--SKIPIF--
<?php if (!extension_loaded("oci8")) print "skip"; ?>
--FILE--
<?php

require dirname(__FILE__).'/connect.inc';

$query = "begin if false then :bv := 1; end if; end;";
$stid = oci_parse($c, $query);
oci_bind_by_name($stid, ":bv", $bv, 22);
oci_execute($stid, OCI_DEFAULT);

var_dump($bv);
unset($bv);

$query = "begin if false then :bv := 1; end if; end;";
$stid = oci_parse($c, $query);
oci_bind_by_name($stid, ":bv", $bv, 22, SQLT_INT);
oci_execute($stid, OCI_DEFAULT);

var_dump($bv);

echo "Done\n";
?>
--EXPECT--	
NULL
int(0)
Done