user_error

(PHP 4, PHP 5, PHP 7)

user_errorAlias of trigger_error()

설명

이 함수는 다음 함수의 별칭입니다: trigger_error().

add a note add a note

User Contributed Notes 1 note

up
0
theahmadzai at hotmail dot com
7 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