#46702 [Opn->Bgs]: On odbc_pconnect() error empty string returned instead of 0

From: Date: Fri, 28 Nov 2008 13:43:33 +0000
Subject: #46702 [Opn->Bgs]: On odbc_pconnect() error empty string returned instead of 0
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1556@lists.php.net to get a copy of this message
ID: 46702 Updated by: rquadling@php.net Reported By: yusp at bk dot ru -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: Windows XP Pro SP2 PHP Version: Irrelevant New Comment: Doing a var_dump() on $ODBCConnect shows that a boolean False is returned. When False is expressed as a string (as in your example), an empty string is the result. This is expected behaviour. http://www.php.net/manual/en/language.types.string.php#language.types .string.casting "A boolean TRUE value is converted to the string "1". Boolean FALSE is converted to "" (the empty string). This allows conversion back and forth between boolean and string values." Previous Comments: ------------------------------------------------------------------------ [2008-11-27 21:48:20] yusp at bk dot ru Description: ------------ Documentation on ODBC functions: http://www.php.net/manual/en/function.odbc-pconnect.php http://www.php.net/manual/en/function.odbc-connect.php On odbc_pconnect() and odbc_pconnect() error empty string is really returned instead of 0 agree to documentation. Reproduce code: --------------- <script Language="PHP"> @$ODBCConnect = odbc_connect ("NonExistentDSN", "", "", SQL_CUR_USE_ODBC); echo "[$ODBCConnect]"; </script> Expected result: ---------------- [0] Actual result: -------------- [] ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46702&edit=1

« previous php.doc.bugs (#1556) next »