note 50974 deleted from function.call-user-func by cmb
| From: | cmb@php.net | Date: | Sun, 08 Dec 2019 11:18:11 +0000 |
| Subject: | note 50974 deleted from function.call-user-func by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213455@lists.php.net to get a copy of this message | ||
Note Submitter: d at safetypub dot org
----
callbacks, this par excellence, goes with set error handler, everywhere you'ren't sure of
extensio de intensionibus (animis alii).
<?php
$checkMe = null;
$detail = array();
set_error_handler("imErrant");
array_shift($argv);
if ($argc == 1){
call_user_func(strtolower($argv[0]));
} else if($argc == 2){
call_user_func(strtolower($argv[0]), $argv[1]);
}
else
call_user_func_array(strtolower($argv[0]),array_shift($argv));
if($checkMe)var_export($detail);
function imErrant($no, $str, $file, $line)
{
global $checkMe, $detail;
$checkMe = $no;
$detail = array($str, $file, $line);
}
?>