채택완료

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개 / 댓글 4개

채택된 답변
+20 포인트

8부터는 더더더 까다로워져서...

옵셔널 체킹 해야되요

?? null로 처리 하는데 

그누최신꺼는 php7.4 랑 8.0까지만 최신화한거 같아요

답변에 대한 댓글 3개

프로그램 소스에서 일일이 수정외에는 방법이 없군요.~ php 옵션상에서 뭔가 설정 하는게 있지 않나 했는데 ㅠ...감사합니다.
7.4로 버전을 내려보세요 백업도 미리하시구요

단순 에러 로그 때문이면

PHP error level 조정해 보세요.

답변에 대한 댓글 1개

아! 그런방법이 있군요. 감사합니다. ^^

답변을 작성하려면 로그인이 필요합니다.