Anyway to capture error/notice output from call_user_func_array

I am using altorouter:

Anytime there's any sort of notice of error, the output is blank...

I have tried everything:



Even putting the same within the function that call_user_func_array is calling...

Nothing is showing up in the logs or anywhere however any errors/notices outside of the call show up fine

Please advise, thanks
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
The function call is inside a conditional statement.  Are you able to test and see if the function is being called at all?  Maybe add var_dump($match) to see what the variable contains.
MarkProgrammerAuthor Commented:
It is being called ...  here is the function

$router->map( 'GET|POST', '/g/contact/[i:id]/', function($i) { load_backend_page('contact', $i); });

function load_backend_page($page,$view='',$action='') {
	global $f;

	$GLOBALS['page'] = $page;
	$GLOBALS['view'] = $view;
	$GLOBALS['action'] = $action;

	if(!isset($_GET['ajax'])) require('views/backend/header.php');
	if(!isset($_GET['ajax'])) require('views/backend/footer.php');


Open in new window

MarkProgrammerAuthor Commented:
The code I am using to call... It works fine however if ever an error or notice is thrown (from when I'm adding new code, etc.), I get completely blank output.

$match = $router->match();

if( $match && is_callable( $match['target'] ) ) {
	call_user_func_array( $match['target'], $match['params'] );
else require('views/general/404.php');

Open in new window

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Ray PaseurCommented:
Are you using this inside some kind of a framework?  The white screen of death is a symptom of deliberately suppressing error output, something that might make sense in a deployed application but something that never makes sense in a test and development environment.  Nevertheless, some frameworks (foolishly) try to limit error display.
MarkProgrammerAuthor Commented:
No, I am building an app to be used on Google App Engine using my own framework. I am using their development tools (contains Web server, PHP, etc.) before deploying the application.
MarkProgrammerAuthor Commented:
I am only getting blank output when an error/notice is thrown from within code executed within call_user_func_array .. any other time; it shows up as expected.
Ray PaseurCommented:
You may want to check the man page carefully -- including the user-contributed notes.  This whole design (PHP's design, not your design) sounds flaky.
MarkProgrammerAuthor Commented:
Well, are there any other options you can suggest to do the same ... altorouter seems very simple but I cannot have blank pages...
Ray PaseurCommented:
Similar routing (RESTful design) is part of the Laravel engine.  Might be worth a look.
Ray PaseurCommented:
But that said, PHP call_user_func_array() is widely used - there may just be something quirky about altorouter's use of it.  There are release-dependent notes in the man pages.  My sense is that careful testing of the inputs to call_user_func_array() may uncover what's going wrong.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MarkProgrammerAuthor Commented:
Thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.