See PHI1653. An install ran into an issue which incidentally was made more complicated because Undefined index: ... PHP runtime errors are not currently converted to exceptions. This is inconsistent with how most other types of similar error are converted.
A relatively surgical fix is to extend the list of notices which convert up:
// Convert uses of undefined variables into exceptions. if (preg_match('/^Undefined variable: /', $str)) { throw new RuntimeException($str); } // Convert uses of undefined properties into exceptions. if (preg_match('/^Undefined property: /', $str)) { throw new RuntimeException($str); } // Convert undefined constants into exceptions. Usually this means there // is a missing `$` and the program is horribly broken. if (preg_match('/^Use of undefined constant /', $str)) { throw new RuntimeException($str); }
However, I suspect we may be able to express this more cleanly and more generally as "all E_NOTICE errors convert to RuntimeException". It's not obvious to me what errors might exist which we'd want to fall through here.
The only cases I can come up with offhand that should fall through are the E_USER cases, where some caller has explicitly invoked trigger_error(). There's still sort of no reason to do this, but the use of trigger_error() instead of throw at least implies some degree of "log and ignore" intent.
(phlog() doesn't trigger a real error, and isn't affected by this.)