Req #28331 [Opn]: Fatal Errors

From: Date: Thu, 08 Jan 2015 22:57:18 +0000
Subject: Req #28331 [Opn]: Fatal Errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189769@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=28331&edit=1 ID: 28331 Updated by: ajf@php.net Reported by: microcamers at hotmail dot com Summary: Fatal Errors Status: Open Type: Feature/Change Request -Package: Feature/Change Request +Package: Scripting Engine problem -Operating System: Windows XP +Operating System: Irrelevant -PHP Version: 5CVS-2004-05-09 (dev) +PHP Version: * Block user comment: N Private report: N New Comment: This would be fixed by this RFC, if adopted: https://wiki.php.net/rfc/engine_exceptions_for_php7 Previous Comments: ------------------------------------------------------------------------ [2012-02-21 13:54:16] lang at b1-systems dot de +1 from my side. Mixing and matching expressions with fatals and return-0-checks is evil and clutters the code. Rationale: At least methods on non-objects can happen when you come from javascript or similar scripting communities which encourage chaining/nesting calls to more or less human-readable commands like $granny_name = $baby->getMother()->getMother()->getName(); In PHP you would rather do $mother = $baby->getMother(); if ($mother) { $granny = $mother->getMother(); if ($granny) { $granny_name = $granny->getName(); } } A comment would be welcome if such a patch would generally be apreciated or you want to keep this fatal as a design decision. If the change is welcome, i'll see if I can provide a patch. ------------------------------------------------------------------------ [2005-12-07 19:54:21] paul dot ossenbruggen at websidestory dot com It would be especially useful to be able to catch a missing function or method errors in an eval() statement with arbitrary code. This can be used in a unit test situation where you want the script to continue to complete other tests. ------------------------------------------------------------------------ [2004-05-09 04:13:48] microcamers at hotmail dot com Description: ------------ Can you make it possible to make most fatal errors catchable, such as the ones for undefined functions, classes, redefined things and so on. Generally make it so any error that can be caught can be caught. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=28331&edit=1

« previous php.bugs (#189769) next »