user_error

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

user_errorПсевдоним 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