PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

환경

PHP-7.3
* 아마도 PHP-7.0 이상이면 발생하는것으로 추정 된다.

 

오류(??)메세지

PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

 

원본코드


class cmssql extends err {
var $conn = null;

function cmssql($aaa, $bbb....

 

원인

class 이름과 function 이름이 동일할 경우 발생하는 메세지

현재 상태에서 당장 “심각” 수준은 아니지만
오류가 발생하기 때문에 조치가 필요하긴 함…

참조 URL : http://docs.php.net/manual/kr/language.oop5.decon.php

처음 메세지를 봤을 때는… “에이 뭐 이런…!!!” 이었으나
글을 보고 나니 “아.. 따르는게 좋겠네…” 라는 느낌..
뭐 난 개발자스런 지식이 없기 때문에 ㅋㅋㅋㅋ

 

수정코드


class cmssql extends err {
var $conn = null;

function __construct($aaa, $bbb

 

 

 

About KENNETH 19688 Articles
지락문화예술공작단

Be the first to comment

Leave a Reply

Your email address will not be published.


*


이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.