Being careful with the comparison operators is not enough:
The reconnect won't be trigged when $link is null.
The manual is just wrong, there are three return values: PGSQL_CONNECTION_OK, PGSQL_CONNECTION_BAD, null
(PHP 4 >= 4.2.0, PHP 5)
pg_connection_status — Restituisce lo stato di una connessione
pg_connection_status() restituisce lo stato di una connessione. I possibili valori sono PGSQL_CONNECTION_OK e PGSQL_CONNECTION_BAD.
Vedere anche pg_connection_busy().
I think zytox is incorrect, at least in PHP 5.0.4.
It returns null, but you have to be careful with your comparison operators.
As an example:
echo 'this is not called';
echo 'this is called because NULL==0 is true';