# handling non-fatal compile-time errors

- Thread: https://externals.io/message/68443
- Original archive: https://news-web.php.net/php.internals/68443
- Started by Ferenc Kovacs on 2013-08-08T15:11:37+00:00
- Messages: 8
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #68443 — Ferenc Kovacs — 2013-08-08T15:11:37+00:00

URL: https://externals.io/message/68443#68443

Hi,

I've just bumped into https://bugs.php.net/bug.php?id=65322 recently, and I
would like you get some opinions on the issue.
Personally I think that it is a really bad design to introduce
pedantic(E_STRICT) errors which can break basic functionality of the engine
(calling the registered autoloader), so if there is no viable solution to
make the autoloader work for these kind of errors, I would like to propose
removing the offending errors and make it a rule to not add compile-time
non-fatal errors until the problem is resolved.

ps: on a related note, somehow I got the feeling that Lester complaining
that `E_STRICT` errors fataling/crashing the application migrated to PHP 5.4
was related to this problem, and I'm a bit sad that we didn't managed to
figure this out back then.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #68460 — Lester Caine — 2013-08-09T08:08:38+00:00

URL: https://externals.io/message/68443#68460 · In reply to: #68443

Ferenc Kovacs wrote:
> ps: on a related note, somehow I got the feeling that Lester complaining
> that `E_STRICT` errors fataling/crashing the application migrated to PHP 5.4
> was related to this problem, and I'm a bit sad that we didn't managed to
> figure this out back then.

I think I'm hitting the same problem here on migrating owncloud from Apache2.2 
to Apache 2.4 ... The site works perfectly on 2.2 but on 2.4 we get 'white 
screen' and absolutely nothing in the error logs. I've spent several hours 
working my way through the 'loader' and identified point which fail, but still 
not nailed why :( I suspect it's apache rewrite messing up the loaded and I'll 
use your revised bug report to see if that helps track debugging!

I get the usual criticism on the owncloud lists asking why I need to change 
Apache, but the answer is the same - the ISP's are moving (GoDaddy did without 
any warning!) but sites simply stop working :(

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

## #68687 — Ferenc Kovacs — 2013-08-29T15:31:46+00:00

URL: https://externals.io/message/68443#68687 · In reply to: #68443

> Hi,
>
> I've just bumped into https://bugs.php.net/bug.php?id=65322 recently, and
> I would like you get some opinions on the issue.
> Personally I think that it is a really bad design to introduce
> pedantic(E_STRICT) errors which can break basic functionality of the engine
> (calling the registered autoloader), so if there is no viable solution to
> make the autoloader work for these kind of errors, I would like to propose
> removing the offending errors and make it a rule to not add compile-time
> non-fatal errors until the problem is resolved.
>
> ps: on a related note, somehow I got the feeling that Lester complaining
> that `E_STRICT` errors fataling/crashing the application migrated to PHP 5.4
> was related to this problem, and I'm a bit sad that we didn't managed to
> figure this out back then.
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>

for the record this is a known(as reported) since 2007:
https://bugs.php.net/bug.php?id=42098
and reported again in 2011:
https://bugs.php.net/bug.php?id=54054&edit=2

do we agree with the resolution from the 2007, eg. it is fine that there an
undefined list of errors (from all and any error level) which behave
differently than most others (as it won't trigger the autoloader) and even
an `E_STRICT` error can blow up a reasonably written application (an expected
error occurs, which happens to be compile time, which will trigger the
autoloader, which will fail to autoload it's dependencies, which will
generate class not found fatal error).

I expect much more similar reports now that people start to migrate to
5.4/5.5 where `E_STRICT` is part of E_ALL(and that the error reporting
infrastructure in an average application is more likely to depend on
autoloading nowadays).

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #69411 — Ferenc Kovacs — 2013-09-29T08:01:39+00:00

URL: https://externals.io/message/68443#69411 · In reply to: #68687

>
>
>
> 
>
> > […]
>
> for the record this is a known(as reported) since 2007:
> https://bugs.php.net/bug.php?id=42098
> and reported again in 2011:
> https://bugs.php.net/bug.php?id=54054&edit=2
>
> do we agree with the resolution from the 2007, eg. it is fine that there
> an undefined list of errors (from all and any error level) which behave
> differently than most others (as it won't trigger the autoloader) and even
> an `E_STRICT` error can blow up a reasonably written application (an expected
> error occurs, which happens to be compile time, which will trigger the
> autoloader, which will fail to autoload it's dependencies, which will
> generate class not found fatal error).
>
> I expect much more similar reports now that people start to migrate to
> 5.4/5.5 where `E_STRICT` is part of E_ALL(and that the error reporting
> infrastructure in an average application is more likely to depend on
> autoloading nowadays).
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>

bump.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #69412 — Nikita Popov — 2013-09-29T11:42:28+00:00

URL: https://externals.io/message/68443#69412 · In reply to: #68443

> Hi,
>
> I've just bumped into https://bugs.php.net/bug.php?id=65322 recently, and
> I
> would like you get some opinions on the issue.
> Personally I think that it is a really bad design to introduce
> pedantic(E_STRICT) errors which can break basic functionality of the engine
> (calling the registered autoloader), so if there is no viable solution to
> make the autoloader work for these kind of errors, I would like to propose
> removing the offending errors and make it a rule to not add compile-time
> non-fatal errors until the problem is resolved.
>

I didn't look into the underlying problem with the autoloader, but just
removing the errors is not a solution. If this is so problematic we should
just drop `E_STRICT` and use more appropriate error types that already exist
- e.g. in the compiler `E_COMPILE_WARNING` can be used, which will not invoke
a custom error handler and as such can't cause this issue. We already have
special error types for the compiler, so why not use them?

Nikita

---

## #69413 — Nikita Popov — 2013-09-29T12:02:56+00:00

URL: https://externals.io/message/68443#69413 · In reply to: #68443

> Hi,
>
> I've just bumped into https://bugs.php.net/bug.php?id=65322 recently, and
> I
> would like you get some opinions on the issue.
> Personally I think that it is a really bad design to introduce
> pedantic(E_STRICT) errors which can break basic functionality of the engine
> (calling the registered autoloader), so if there is no viable solution to
> make the autoloader work for these kind of errors, I would like to propose
> removing the offending errors and make it a rule to not add compile-time
> non-fatal errors until the problem is resolved.
>

By the way, there is no problem per-se to allow autoloading there (nested
compilation due to error handlers is properly handled), the reason it
currently has the in_compilation check there is to prevent all the class
lookups from the compiler to trigger the autoloader (the compiler makes
extensive use of zend_lookup_class, which sets use_autoload=1). If all
lookups in the compiler are changed to use zend_lookup_class_ex with
use_autoload=0 it might be possible to remove the condition there.

Nikita

---

## #69414 — Ferenc Kovacs — 2013-09-29T14:59:06+00:00

URL: https://externals.io/message/68443#69414 · In reply to: #69413

> 
>
> > […]
>
> By the way, there is no problem per-se to allow autoloading there (nested
> compilation due to error handlers is properly handled), the reason it
> currently has the in_compilation check there is to prevent all the class
> lookups from the compiler to trigger the autoloader (the compiler makes
> extensive use of zend_lookup_class, which sets use_autoload=1). If all
> lookups in the compiler are changed to use zend_lookup_class_ex with
> use_autoload=0 it might be possible to remove the condition there.
>
> Nikita
>

Thanks for the reply, about the requirement of the in_compilation check:
even recent comments stated that it is because the compiler not being
reentrant (see the last comments from
https://bugs.php.net/bug.php?id=54054&edit=1).
Personally I would be fine with the separate error level, but if we could
allow the autoloader there, that would be fantastic

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #69415 — Ferenc Kovacs — 2013-09-29T17:13:16+00:00

URL: https://externals.io/message/68443#69415 · In reply to: #69414

>
>
>
> On Sun, Sep 29, 2013 at 2:02 PM, Nikita Popov <nikita.ppv@gmail.com>wrote:
>
> > […]
>
> Thanks for the reply, about the requirement of the in_compilation check:
> even recent comments stated that it is because the compiler not being
> reentrant (see the last comments from
> https://bugs.php.net/bug.php?id=54054&edit=1).
> Personally I would be fine with the separate error level, but if we could
> allow the autoloader there, that would be fantastic
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>

For the record: Nikita just fixed the issue:
http://git.php.net/?p=php-src.git;a=commit;h=f0c926564c5f7de9462d9ca7bd75014b14a63f56
_o_

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu
