I have a 3 php files, lets say [a,b,c].php
a.php does
$constants=parse_ini_file(ROOT_DIRECTORY."constants.ini", true);
b.php uses constants from that file via
function func(){
var_dump($constants["xyz"]["abc"]);
}
and c.php includes them both
include "a.php";
include "b.php";
func();
Now when i visit /c.php
I expect that it should be able to display the constants, but instead I get Undefined variable: constants in b.php
Is this expected to not work? Or am I doing something wrong?