-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix return values for mysqli #6540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix return values for mysqli #6540
Conversation
ZEND complains that the mysqli_connect function can indeed return null.
php-src/ext/mysqli/mysqli_api.c Lines 1449 to 1467 in 269936e
If |
@cmb69 So if I understand you correctly the only possible return values for |
The point is whether |
@cmb69 The check for
Either way, I really think we should remove this method. It's so useless. |
Codecov Report
@@ Coverage Diff @@
## master #6540 +/- ##
==========================================
- Coverage 72.66% 72.37% -0.30%
==========================================
Files 800 816 +16
Lines 310075 311041 +966
==========================================
- Hits 225329 225104 -225
- Misses 84746 85937 +1191
Continue to review full report at Codecov.
|
That makes sense. However, that also implies that
I generally find it confusing if dual APIs work differently for function and method. In this case, |
mysqli::init() doesn't return any values. It just calls the mysqli constructor.
mysqli_connect() returns an object or false. I can't see any way that it would ever return null. Am I wrong?