#25935 [Opn->Bgs]: pg_connection_status strange behaviour
| From: | helly@php.net | Date: | Tue, 21 Oct 2003 18:33:20 +0000 |
| Subject: | #25935 [Opn->Bgs]: pg_connection_status strange behaviour | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-49297@lists.php.net to get a copy of this message | ||
ID: 25935
Updated by: helly@php.net
Reported By: edechaux at irci dot fr
-Status: Open
+Status: Bogus
Bug Type: PostgreSQL related
Operating System: Linux 2.4.21
PHP Version: 4.3.3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Your code is wrong, use ===, see below why:
marcus@zaphod /usr/src/php5 $ php -r
'var_dump(pg_connection_status(false));'
bool(false)
marcus@zaphod /usr/src/php5 $ php -r 'var_dump(PGSQL_CONNECTION_OK);'
int(0)
Previous Comments:
------------------------------------------------------------------------
[2003-10-21 10:58:04] edechaux at irci dot fr
Description:
------------
I have notice a strange beaviour with the pg_connection_status
function.
See this code :
Reproduce code:
---------------
echo pg_connection_status (false) == PGSQL_CONNECTION_OK ? 'strange' :
'ok';
Expected result:
----------------
I think I should see 'ok' on the screen. false is not a valid Postgres
connection.
Actual result:
--------------
However 'strange' is written on the screen.
It may not be a bug. But this behaviour should be written in the doc.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25935&edit=1