Doc #65534 [NEW]: result of mysqli::__connect
From: kit dot lester at mail dot com
Operating system:
PHP version: 5.5.3
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:result of mysqli::__connect
Description:
------------
It would be nice if the description of the result in the manual page on
mysqli::__construct() could say something like that the result "is of type
mysqli, even if the connection fails (i.e. never null)"; and somewhere
(maybe with the result) that errno should be checked to determine whether
the operation failed.
An early example with a note that one doesn't do things the C/C++ way would
also be enlightening.
This would assist those of us coming from systems in which failures of
constructors commonly return NULL and failures of functions commonly return
FALSE - very common in libraries for C and languages derived from C.
[I can't be alone in being a little slow to realize that you've done thing
in a better way, at the price that I've some extra work to do in converting
code to PHP+mysqli :-) ]
Much the same applies to all other manual pages on any constructor or
method with an errno (or in this case connect_errno) that should routinely
be checked - so (apologies!) this is a meta-comment applying to many of the
manual's pages. [My own old scars tell me that I'd requesting a substantial
documentation-editing effort.]
--
Edit bug report at https://bugs.php.net/bug.php?id=65534&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65534&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65534&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65534&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65534&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65534&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65534&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65534&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65534&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65534&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65534&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65534&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65534&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65534&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65534&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65534&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65534&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65534&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65534&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65534&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65534&r=mysqlcfg
Thread (2 messages)
- kit dot lester at mail dot com