Anyway to capture error/notice output from call_user_func_array

I am using altorouter: http://altorouter.com/usage/processing-requests.html

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

I have tried everything:

error_reporting(E_ALL);

ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);

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
MarkProgrammerAsked:
Who is Participating?
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.
0
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');
	require("views/backend/{$page}.php");
	if(!isset($_GET['ajax'])) require('views/backend/footer.php');

}

Open in new window

0
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

0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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.
0
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.
0
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.
0
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.
http://php.net/manual/en/function.call-user-func-array.php
0
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...
0
Ray PaseurCommented:
Similar routing (RESTful design) is part of the Laravel engine.  Might be worth a look.
0
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.
0

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
0
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
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.