I have a script which similar to this:
foo.php
class Foo
{
function Foo() {
$Registry = array();
include 'bar.php';
$Registry['bar'] = new Bar();
}
}
bar.php
class Bar
{
function Bar() {
global $Registry;
print_r(var_dump($Registry));
}
}
but that returns:
array
'Registry' => &null
Does anyone have any suggestions as to why it’s not identifying the Registry variable as an array?
you have to create $register global and outside of your class
bar.php