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

Issue Type: Bug Created: 2009-05-22T13:17:51.000+0000 Last Updated: 2009-05-25T18:24:04.000+0000 Status: Resolved Fix version(s): - 1.8.1 (12/May/09)

Reporter: Philip (guice) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Loader

Related issues: Attachments:


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().


Posted by Matthew Weier O'Phinney (matthew) on 2009-05-25T18:23:34.000+0000

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

<pre class="highlight">
$loader = Zend_Loader_Autoloader::getInstance();

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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.