echo $path; // working
function createList($retval) {
global $path;
echo $path; // working
define(PATH, "/my/test/path"); // You can put this in an include file as well.
echo PATH; // working
function createList($retval) {
echo PATH; // working
echo $path; // working
function createList($retval, $path) {
echo $path; // working
根据功能的实际工作原理,其中之一会起作用。