page rendering stops after php error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
In a nutshell:  When php encounters an error, it stops rendering the
page.  The last bit of html rendered before the error is where it

I've tried using the "@" symbol technique to bypass errors.  Ive tried
every error setting in php.ini I can find.  Ive used try/catch blocks,
etc.   I can get the error to not show, but the page still stops
rendering right where the errror occured.

Im using the lastest version of Wordpress (2.3) and the latest version
of Simplepie.  I wrote a small plugin to display the Blogroll
information 5 blogs at a time via a fader, blah blah.  So i basically
am calling a function somewhere in the wordpress template to the
special blogroll function get_blogroll_html();  All html and php
scripting after this call does not exist whenever the
get_blogroll_html() function generates an error.

Is there a way to tell php to continue rendering and executing code
after an error?  If try/catch blocks don't work, does this mean im not
trapping the error correctly?


Re: page rendering stops after php error

On Feb 26, 1:19 pm, wrote:
Quoted text here. Click to load it

What is the error you're getting?  If the error is fatal then, yes,
the script will die.  If it's a warning or notice it won't.  Fatal
errors are not typically something that you want to "handle" -- that's
what makes them fatal.

Re: page rendering stops after php error


Quoted text here. Click to load it

Indeed, fatal errors like syntax etc. are just that, fatal. No way to  
catch them, save for spawning another process and capturing the output, or  
discard it. For other errors, if you want to use exceptions, be sure the  
code (including that of external libraries) uses exceptions rather the  
errors (trigger_error()). As exceptions were only introduced in PHP5, a  
lot of modules/libraries/extensions still either use errors, or can be  
configured to use eiter errors or exceptions.
Rik Wasmus

Re: page rendering stops after php error

Quoted text here. Click to load it

But you can pre-empt some of them (well, actually only one springs to
mind - missing class or function definition) - just call
function_exists or class_exists before any code which uses the class/

if (class_exists('widget', true)) {
   $bar=new widget();
   if (function_exists('foo')) {
       print foo($bar);


Site Timeline