user_error

FunctionReturn type changed in PHP 8.4

Alias of trigger_error.

PHP 5
PHP 7
PHP 8.0
Improved
PHP 8.1
PHP 8.2
PHP 8.3
PHP 8.4
Improved
PHP 8.5

user_error Function synopsis

user_error(string $message, int $error_level = E_USER_NOTICE): true

Parameters

$message

Typestring

$error_level

OptionalTypeintDefault valueE_USER_NOTICE

$error_level accepts one of the following constant values:

Return value

Typetrue

Changes to the user_error Function

PHP 8.4

  • Return type changed: bool to true
- user_error(string $message, int $error_level = E_USER_NOTICE): bool
+ user_error(string $message, int $error_level = E_USER_NOTICE): true

PHP 8.0

  • Return type added: bool
  • Parameter type added for parameter #1 ($message): string
  • Parameter name of parameter #2 changed: $error_type to $error_level
  • Parameter type added for parameter #2 ($error_level): int
  • Parameter default value added for position #2 ($error_level): E_USER_NOTICE
- user_error($message, $error_type)
+ user_error(string $message, int $error_level = E_USER_NOTICE): bool

user_error Function Availability

PHP VersionAvailability
PHP 8.5Future Release Yes
PHP 8.4Upcoming Release Yes
PHP 8.3Supported (Latest) Yes
PHP 8.2Supported Yes
PHP 8.1Security-Fixes Only Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported Yes
PHP 5.5Unsupported Yes
PHP 5.4Unsupported Yes
PHP 5.3Unsupported Yes