php8 null 오류..
관련링크
본문
웹서버 php_error 로그를 보면 null 관련 에러값이 무척이나 쌓여 갑니다.
[25-Apr-2023 10:33:31 Asia/Seoul] PHP Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in
[25-Apr-2023 12:16:13 Asia/Seoul] PHP Deprecated: hash_pbkdf2(): Passing null to parameter #2 ($password) of type string is deprecated in
[25-Apr-2023 12:16:32 Asia/Seoul] PHP Deprecated: number_format(): Passing null to parameter #1 ($num) of type float is deprecated in
[25-Apr-2023 10:19:56 Asia/Seoul] PHP Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated
php 버전은 PHP Version 8.1.10 을 사용 하고 있는데요.
자료를 찾아보니 하위 버전에는 빈공백으로 처리 되던게 php8 부터는 null 로 변경되서 나오는 에러 같다고 합니다.
일일이 찾아서 null 여부 체크하여 변경 하려니 걸리는 곳이 워낙 많아서..
간단히 변경 할수 있는 방법이 없을까요?
답변 2
8부터는 더더더 까다로워져서...
옵셔널 체킹 해야되요
?? null로 처리 하는데
그누최신꺼는 php7.4 랑 8.0까지만 최신화한거 같아요
단순 에러 로그 때문이면
PHP error level 조정해 보세요.