#25935 [Bgs]: pg_connection_status strange behaviour

From: Date: Wed, 22 Oct 2003 07:18:21 +0000
Subject: #25935 [Bgs]: pg_connection_status strange behaviour
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-49324@lists.php.net to get a copy of this message
 ID:               25935
 User updated by:  edechaux at irci dot fr
 Reported By:      edechaux at irci dot fr
 Status:           Bogus
 Bug Type:         PostgreSQL related
 Operating System: Linux 2.4.21
 PHP Version:      4.3.3
 New Comment:

ok, it works now.

Thank you.


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

[2003-10-21 14:33:19] helly@php.net

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)

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

[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


Thread (3 messages)

« previous php.bugs (#49324) next »