This, too, is not an actual bug, but rather a suggestion:
This may be because of me migrated from C/C++ to PHP but, it is good practice that instead of returning false or true, returning an integer (mostly defined as a constant) as the result of a function, mostly 0 for success and not zero as the error code. Then, checking the function is simply
if ($err = myfunc())
{
switch($err)
{
case ERR_CASE_ONE:
{
// approperiate action for case one
break;
}
...
default:
{
// approperiate action for unknown error
break;
}
}
}
And mostly these errors can be masked. For instance you can mask them with PHP's default error level masks like E_ALL and E_WARNING etc. to form a robust error reporting.
Hi! Sorry to bother you again.
This, too, is not an actual bug, but rather a suggestion: This may be because of me migrated from C/C++ to PHP but, it is good practice that instead of returning false or true, returning an integer (mostly defined as a constant) as the result of a function, mostly 0 for success and not zero as the error code. Then, checking the function is simply
And mostly these errors can be masked. For instance you can mask them with PHP's default error level masks like
E_ALL
andE_WARNING
etc. to form a robust error reporting.