ID:               36827
 User updated by:  jjackson at medai dot com
 Reported By:      jjackson at medai dot com
-Status:           Bogus
+Status:           Open
 Bug Type:         OCI8 related
 Operating System: Linux
 PHP Version:      5.1.2
 New Comment:

for something that "CAN'T" return true, how is my code and results
possibly returning true? :-)


Previous Comments:
------------------------------------------------------------------------

[2006-03-22 23:20:28] [EMAIL PROTECTED]

http://php.net/manual/en/language.operators.php#language.operators.precedence

------------------------------------------------------------------------

[2006-03-22 23:13:32] [EMAIL PROTECTED]

You must be doing something terribly wrong, because oci_connect() CAN'T
return true. It can return either false or valid connection.
And I'm definitely not able to reproduce it.

------------------------------------------------------------------------

[2006-03-22 23:04:57] jjackson at medai dot com

Description:
------------
The PHP documentation has led me to believe that "oci_connect() returns
a connection identifier needed for most other OCI calls" (verbatim from
the docs). For the sake of simplicity in this example, I just want to
connect then close the connection. However, my call to oci_close()
doesn't like what oci_connect() returned.....thinking it's a boolean
value instead of the "resource" as shown at:
http://us2.php.net/manual/en/function.oci-connect.php

I know it's actually talking to the server because it gives me a logon
failure when I use an invalid username/password. 

Reproduce code:
---------------
#!/usr/local/bin/php
<?
$conn = oci_connect('username', 'password', '//server:1521/dbname') ||
die("Could not connect to Oracle database");
var_dump($conn);
oci_close($conn);
?>

Expected result:
----------------
to not get the warning I am seeing.

Actual result:
--------------
bool(true)

Warning: oci_close() expects parameter 1 to be resource, boolean given
in /my/problem/script on line 5


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36827&edit=1

Reply via email to