Cannot redeclare

· Language/PHP
PHP Fatal error: Cannot redeclare function() (previously declared in ~) 주로 상단에 include한 파일중에 이미 선언된 function 이름과 같은 function을 또 선언했을때 나타나는 오류. function_exists()로 선언하고자 하는 function 이름이 이미 선언되어 있는지 체크 필요. 예시) // Bad; @include_once '/data/functions.php'; function test_function(){ } // GOOD! @include_once '/data/functions.php'; if(function_exists('test_function') == false){ function test_function(){..
MingyuKim
'Cannot redeclare' 태그의 글 목록

페이지 로딩중입니다. 잠시 기다려주세요!

민규의 블로그

도움이 되셨다면 구독 부탁합니다!