That won't be a scope issue. That sounds like an order of execution issue. error_get_last should work independently of any scope:
PHP Code:
error_reporting(0);
function func()
{
print $var;
}
func();
print_r(error_get_last());
will result in
Code:
Array
(
[type] => 8
[message] => Undefined variable: var
[file] => /t.php
[line] => 7
)
So the problem is that the error is triggered sometime after the processing has occurred where you have put it.