Hi all,
thanks for the replies.
@Arantor:
Yeah, changing the functions signature is the solution, thanks!
@feline:
To come closer to the problems nature:
function worker() {
$log = array();
$log[] = 'top of log';
call_user_func_array('log_error', array(&$log)); //call by reference
show_log($log); /*call by value!*/ }
/*function log_error($db)*/ // - works up to PHP5.3!
function log_error(&$db) /* right signature under PHP5.4 */ {
$db[] = 'Oh Matt, what are you doin?'; }
function show_log($db) {
foreach ($db as $rec) { printf("%s<br />", $rec); } }
echo 'running php5.4<br />'; worker();