global $var;
을 사용하는 변수에 대해 전역 범위를 정의하지 않고 서버에서 작동하지만 내 로컬 시스템에서는 작동하지 않는 PHP 시스템이 있습니다.
PHP의 범위 규칙에서 변경 되었습니까? 아니면이를 허용하는 설정이 있습니까? 내 로컬 시스템은 PHP 5.5.36을 실행 중이며 서버가 실행중인 버전을 알지 못합니다.
편집 : 추가 코드 샘플은
이 실행하는 서버에서이 지역 PHP에서 작동
include_once("common.inc.php"); // this defines $physical_path
class Admin extends AdminData
{
function Admin($admin_auth_id='') {
include_once($physical_path['DB_Access']. 'SubadminCommittee.php');
// many more lines of code follow
}
}
에서 작동 5.5.36
include_once("common.inc.php"); // this defines $physical_path
class Admin extends AdminData
{
function Admin($admin_auth_id='') {
global $physical_path; // why is this line not needed on server?
include_once($physical_path['DB_Access']. 'SubadminCommittee.php');
// many more lines of code follow
}
}
코드 샘플을 참조하십시오. 우리는 애매한 묘사에 기초하여 이것에 관해 아무 것도 말할 수 없습니다. – deceze
@deceze 불행히도 코드 예제를 추가했습니다. 서버에서이 코드를 재현 할 수 없으며 간단한 예제를 만들 수있는 곳이 없습니다. 나는이 시스템을 만들지 않았다. –