user_error

(PHP 4, PHP 5, PHP 7, PHP 8)

user_errortrigger_error() のエイリアス

説明

この関数は次の関数のエイリアスです。 trigger_error().

add a note add a note

User Contributed Notes 1 note

up
0
theahmadzai at hotmail dot com
5 years ago
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
To Top