Issues

ZF-6784: Zend_Loader_Autoloader() unable to handle startup errors.

Description

When attempting to auto-load files with startup errors: not implementing abstract method; unable to define methods as static; unexected T_STRING, T_VARIABLE, etc, you're given a 500 Internal Server error, with no output in the logs.

Test: Created class that's loaded through the autoloader (1.8), with a syntax error. I used: foreach ( $var %optin ); (note missing 'as'). Expected results: Parse error: syntax error, unexpected T_VARIABLE in on line

What I actually get is 500 internal server error, with nothing in the logs.

display errors is on. error_reporting is set to E_ALL. Notice errors properly show when 'as' is within the foreach statement. Removing 'as' from the foreach causes internal server error.

The full process of the autoloader is a bit difficult for me to test in my current environment setup; however, I have verified doing a require_once('PFC/Ws/Optins.php'); early in the process ( _initConfig() within Boostrap class ) echoes out: Parse error: syntax error, unexpected T_VARIABLE in /home/httpd/dev-sites/application/models/PFC/Ws/Optins.php on line 24

Commenting out that line then just calling: PFC_Ws_Optins::OBJECT_NM results in 500 Internal Server error with no error messages printed out anywhere (nothing in logs, nothing on page).

My deductions conclude it's something with the Zend_Loader_Autoloader().

Comments

1.8.0 mistakenly enabled the suppressNotFoundWarnings flag. You can disable it:


$loader = Zend_Loader_Autoloader::getInstance();
$loader->suppressNotFoundWarnings(false);

In 1.8.1, we set the flag to the appropriate value (which displays "not found" and parse errors).