#44270 [Opn->Fbk]: $mysqli->info is NULL, not an empty string, for "not supported situations"

From: Date: Sun, 02 Nov 2008 13:34:31 +0000
Subject: #44270 [Opn->Fbk]: $mysqli->info is NULL, not an empty string, for "not supported situations"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-130512@lists.php.net to get a copy of this message
ID: 44270 Updated by: jani@php.net Reported By: stein at visibone dot com -Status: Open +Status: Feedback Bug Type: MySQLi related Operating System: * PHP Version: 5.2.5 Assigned To: andrey Previous Comments: ------------------------------------------------------------------------ [2008-11-02 13:34:14] jani@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ ------------------------------------------------------------------------ [2008-07-25 17:40:17] stein at visibone dot com uw I can mostly buy what you're selling. Firstly, the doc should not lie, so changing the doc, or changing the code works for me. Secondarily, consistency is good, other things being equal. mysqli_info() should fail the same way as $mysqli->info I still slightly prefer the empty string because it fails a little more gently, and there are much less ill-mannered ways of checking for failure than comparing this field with NULL or ''. But I defer to whatever noble soul does the actual work. ------------------------------------------------------------------------ [2008-07-24 12:08:55] uw@php.net The more I think about it, the better I like NULL. NULL will be used on the C-level, under the hood. false gets used in ext/mysql. And both NULL and false have a different meaning than empty string. An empty string means that there is some information - even if the string is empty. NULL means that no information is available. In any case the procedural and OO interface should return the same value. Comments? I don't mind the PHP manual much as its a very minor change which most people will not notice as NULL == '' is true. ------------------------------------------------------------------------ [2008-07-15 16:06:20] uw@php.net ... and of course: free to fix for whoever comes first ------------------------------------------------------------------------ [2008-07-15 16:05:27] uw@php.net Bug - I'll modify mysqi_info.phpt to cover this detail. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/44270 -- Edit this bug report at http://bugs.php.net/?id=44270&edit=1

« previous php.bugs (#130512) next »