php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67637 mysqli::ping() should not send E_NOTICE
Submitted: 2014-07-17 07:39 UTC Modified: 2017-04-26 11:15 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:0 of 0 (0.0%)
From: php dot net at dzubak dot sk Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.5.14 OS: Linux
Private report: No CVE-ID: None
 [2014-07-17 07:39 UTC] php dot net at dzubak dot sk
Description:
------------
I use mysqli::ping() to test whether MySQL connection is still alive (scripts waits long before using MySQL again).

On FALSE, it also sends E_NOTICE which is not (IMO) appropriate, since function returns TRUE/FALSE on success/failure.

Expected result:
----------------
I expect mysqli::ping() just to return TRUE/FALSE.

When I use $variable without initialisation, I get E_NOTICE and so if I want to avoid getting E_NOTICE, I use isset($variable) before using $variable itself.

I expected same behaviour from mysqli::ping() - just let me know if connection is dead or alive and do not mess with my logs too, it is redundant without advantage.

Actual result:
--------------
mysqli::ping() returns TRUE/FALSE, but it also sends E_NOTICE "mysqli::ping(): send of 5 bytes failed with errno=32 Broken pipe".


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-26 11:15 UTC] fjanisze@php.net
-Status: Open +Status: Not a bug
 [2017-04-26 11:15 UTC] fjanisze@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC