$errors = array();
function test(){
return $errors[] = 'empty_test';
}
test();
print_r($errors);
$errors = array();
function test( &$arr) {
$arr[] = 'empty_test';
}
test( $errors);
print_r($errors); /*
Array
(
[0] => empty_test
)
*/
$errors = array();
function test(){
global $errors;
return $errors[] = 'empty_test';
}
test();
print_r($errors);
$errors = array();
function test() {
global $errors;
$test = 'empty_test';
$errors[] = $test;
return $test;
}
test();
print_r($errors);