[12-Oct-2018 20:52:24 Etc/GMT-9] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; BeluxeItem has a deprecated constructor in E:\www\thedaegu\modules\beluxe\classes.item.php on line 8
[12-Oct-2018 20:52:24 Etc/GMT-9] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; examItem has a deprecated constructor in E:\www\thedaegu\modules\exam\exam.item.php on line 7
[12-Oct-2018 20:52:24 Etc/GMT-9] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; questionItem has a deprecated constructor in E:\www\thedaegu\modules\exam\exam.question.item.php on line 7
[12-Oct-2018 20:52:24 Etc/GMT-9] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; faqItem has a deprecated constructor in E:\www\thedaegu\modules\faq\faq.item.php on line 8
[12-Oct-2018 20:52:24 Etc/GMT-9] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; marketplaceItem has a deprecated constructor in E:\www\thedaegu\modules\marketplace\marketplace.item.php on line 10
 

사용환경은 다음과 같습니다.

rhymix_version : 1.9.8.2

db.type : mysqli (innodb, utf8mb4) db.version : 10.0.35-MariaDB cache.type : redis

php : 7.2.10 (64-bit) server : Microsoft-IIS/10.0 os : Windows NT 10.0

  • profile

    오류는 아닙니다. 해당 자료의 작동 여부에 영향을 주지도 않습니다. Deprecated 메시지는 "아직은 오류가 아니지만 PHP 차기 버전에서는 작동하지 않을 수도 있으니 미리 고쳐놓는 게 신상에 좋을 거다"라는 경고입니다. 대개 Deprecated가 뜨고 나서 두세 버전이 더 지나가면 (PHP 7.3~7.4 정도?) 정말로 오류가 나기 시작합니다.

     

    파일명을 보니 모두 꽤 오래된 서드파티 자료에서 Deprecated가 발생하고 있네요. 클래스 생성자(constructor)를 옛날 방식으로 선언해 놓아서 일어나는 현상입니다.

     

    예를 들어 아래와 같이 클래스명과 함수명이 동일한 소스가 있으면 Deprecated 메시지를 뿜을 겁니다.

     

        class marketplaceItem {

            function marketplaceItem() {

                // 클래스명과 함수명이 동일!!

            }

        }

     

    아래와 같이 되어 있어야 합니다.

     

        class marketplaceItem {

            function __construct() {

                // 정상

            }

        }

     

    클래스 생성자는 이렇게 써야 한다고 바뀐 지... 음... 이제 14년 정도 됐습니다만 ㅡ.ㅡ;;

    XE 코어에서도 불과 며칠 전 릴리즈된 1.11에서야 겨우 고쳐졌어요.

  • profile
    언제나 명쾌한 답변 감사드립니다. ㅎㅎ