Req #63538 [Asn->Csd]: "Call to undefined function" should be catchable
Edit report at https://bugs.php.net/bug.php?id=63538&edit=1
ID: 63538
Updated by: nikic@php.net
Reported by: indeyets@php.net
Summary: "Call to undefined function" should be catchable
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: any
PHP Version: 5.5.0alpha1
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
It's possible to catch this as of PHP 7, see https://wiki.php.net/rfc/engine_exceptions_for_php7.
Previous Comments:
------------------------------------------------------------------------
[2013-06-28 08:27:59] yohgaki@php.net
This is a PoC patch for catching E_ERROR/E_PARSE.
https://github.com/yohgaki/php-src/compare/master-catch-e_error
------------------------------------------------------------------------
[2013-06-28 07:14:05] yohgaki@php.net
Old PHPs were able to catch E_ERROR.
I always think E_ERROR should be able to catch by user defined error handler. The
reason why E_ERROR made uncatchable is there were many users that shot their own
foot by not terminating execution. However, user should be able to own foot by
catching E_ERROR.
I think PHP should give chance user to display 500 page.
------------------------------------------------------------------------
[2013-04-30 11:28:07] jevon at jevon dot org
In particular, this would allow developers to handle undefined functions in batch scripts and the
like. Since one can catch undefined classes (through an autoloader), undefined class methods
(through __call() and __callStatic()) and undefined variables (through set_error_handler()), why
shouldn't we be able to catch undefined functions?
------------------------------------------------------------------------
[2012-11-29 10:37:38] indeyets@php.net
bensor987 that's a separate issue. autoloader is a specific solution, while
ability to handle such error is more generic
------------------------------------------------------------------------
[2012-11-29 10:15:05] bensor987 at neuf dot fr
I think it is better to add a function autoloader, instead of just catching this error.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=63538
--
Edit this bug report at https://bugs.php.net/bug.php?id=63538&edit=1
Thread (8 messages)