Has this ever happened to you? A website that has been running spotlessly for years needs some maintenance work to bring the code up to date with new versions of the software or to add a feature and as a consequence a new bug shows up but one that is only triggered by a remote client. To complicate matters, the error log does not have enough information  to let you reproduce the bug. What to do? Write some code to solve the problem! That's how Class phpDebug was born!good code
good code
new phpDebug();
code that triggers the bugThe normal php error log will give you the file name and line number that triggers the bug. You insert the  code to instantiate the phpDebug class and wait for a remote user to trigger the bug.new phpDebug(array('alpha'=>$alpha, 'beta'=>$beta));public function getDbResult($sql) {
if($result = $this->mysqli->query($sql)) { {
return $result;
}
// to check for SQL injections
new phpDebug($sql);
trigger_error("Database: {$this->mysqli->error}", E_USER_ERROR);
} // getDbResult()
Please do not reply to this email.
This is an automated message from phpErrorReporter at the indicated domain
Domain: myDomain.com
PHP Program Notice
Time: 18-Nov-2017 15:30:11
Notice: 
Trace:
#0  phpDebug->trace() called at [/home/user/includes/classes/phpDebug.php:63]
#1  phpDebug->__construct() called at [/path/to/calling/script:256]
#2  include(/path/to/include/file) called at [/path/to/webpage:5]
					 Server:
Array
(
   [PATH] => /usr/local/bin:/usr/bin:/bin
   [REDIRECT_HANDLER] => application/x-httpd-ea-php56
   [REDIRECT_STATUS] => 200
   [UNIQUE_ID] => WhCKQuIe154rZzdwBeADswAAAFc
   [HTTP_HOST] => myDomain.com
   ...
   ...
   ...
   [ORIG_SCRIPT_NAME] => /cgi-sys/ea-php56
   [PHP_SELF] => /contact.php
   [REQUEST_TIME_FLOAT] => 1511033411.07
   [REQUEST_TIME] => 1511033411
   [argv] => Array
       (
       )
   [argc] => 0
)
					 Get:
N/A
					 Post:
Array
(
   [name] => 
   [email] => 
   [subject] => 
   [comment] => 
   [contact_action] => Review
)
					 Cookie:
Array
(
   [PHPSESSID] => ep08e2to26e9o78b81lc3sdob6
)
					 Variables:
N/A