Re: E_STRICT 'errors' - was Are exceptions allowed in php core?

From: Date: Tue, 04 Sep 2012 19:20:11 +0000
Subject: Re: E_STRICT 'errors' - was Are exceptions allowed in php core?
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-62811@lists.php.net to get a copy of this message
Now that you have changed the subject, I feel free to break in with a voice from userland. Rasmus Lerdorf in php.internals (Tue, 04 Sep 2012 09:57:59 -0700): >Even with E_STRICT off (...) Sometimes it is not easy for users to turn off E_STRICT. Lester already mentioned one scenario: ISP's tend to install PHP with the default settings without the possibility to change them. Another scenario is the one that a framework or CMS overrides the php.ini settings. Quote from the bootstrap.inc of drupal7: // Enforce E_ALL, but allow users to set levels not part of E_ALL. error_reporting(E_ALL | error_reporting()); For the sake of argument I changed our development server from PHP 5.3.16 to PHP 5.4.6. I immediately got confronted with warnings like "Warning: Illegal string offset 'field' in EntityReference_SelectionHandler_Generic_user->entityFieldQueryAlter()" I know it is very bad coding in drupal7's bootstrap.inc. Read the comments at http://drupal.org/node/1267246 and you'll see I am not alone. Nevertheless, I am not interested in warnings like the one above from one of the many modules in drupal7. But I cannot turn off E_STRICT in drupal7 without changing bootstrap.inc manually. And that is the last thing I want to do. So I am changing our development server back to PHP 5.3.16. The E_STRICT change prevents me from upgrading to PHP 5.4. In my case I can just wait for a patch of bootstrap.inc. But users on a shared hosting server may have no way to avoid these warnings. Jan

« previous php.internals (#62811) next »