I have an error class that handles a my errors. I'm wanting to call a object that was instanciated outside an object, from inside an object, with out passing it in.
for example
Code: Select all
<?php
global $error;
$error = new Error();
class test
{
function foo()
{
$error->throwError();
}
}
$newTest = new test();
$newTest->foo();
?>Thanks in advance.