note 120948 deleted from function.user-error by cmb
| From: | cmb@php.net | Date: | Thu, 06 Apr 2017 18:07:16 +0000 |
| Subject: | note 120948 deleted from function.user-error by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208994@lists.php.net to get a copy of this message | ||
Note Submitter: theahmadzai at hotmail dot com
----
Works same as trigger_error, in fact, it is the alias of trigger error.
function myFunction($arg)
{
if (is_numeric($arg)) {
echo 'Good';
} else {
user_error(__FUNCTION__ . " Requires a numeric argument, You have given " .
gettype($arg) . " Value: {$arg}");
}
}
myFunction(3);
myFunction('a');
/************************
* Output
*************************/
>> Good
>> Notice: myFunction Requires a numeric argument, You have given string Value: a