diff --git a/src/Ctype/Ctype.php b/src/Ctype/Ctype.php index ba75a2c95..448d639ff 100644 --- a/src/Ctype/Ctype.php +++ b/src/Ctype/Ctype.php @@ -211,6 +211,10 @@ public static function ctype_xdigit($text) */ private static function convert_int_to_char_for_ctype($int, $function) { + if (\PHP_VERSION_ID >= 80100 && !\is_string($int)) { + @trigger_error($function.'(): Argument of type '.get_debug_type($int).' will be interpreted as string in the future', \E_USER_DEPRECATED); + } + if (!\is_int($int)) { return $int; } @@ -219,10 +223,6 @@ private static function convert_int_to_char_for_ctype($int, $function) return (string) $int; } - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - if ($int < 0) { $int += 256; }