我php
在同一目录中有以下文件:
connection.php
index.php
lib.php
相关代码connection.php
:
....
....
$client = 4; //something that I've defined here
....
....
相关代码index.php
require_once('connection.php');
require_once('lib.php');
....
function_search(); //function of lib.php
....
....
相关代码lib.php
class function_my_exception extends function_your_exception {
function __construct($hint, $debuginfo=null) {
parent::__construct($hint, 'debug', '', $hint, $debuginfo);
}
}
function function_search(){
....
....
if ($client !=4 )
//Do something
}
当我运行时index.php
,我不断收到错误Undefined variable $client" in line xxx of lib.php