Req #79466 [Com]: Fatal errors because of recursion should be exceptions
Edit report at https://bugs.php.net/bug.php?id=79466&edit=1
ID: 79466
Comment by: bugreports at gmail dot com
Reported by: david at grudl dot com
Summary: Fatal errors because of recursion should be
exceptions
Status: Open
Type: Feature/Change Request
Package: Arrays related
PHP Version: Next Major Version
Block user comment: N
Private report: N
New Comment:
may i suggest that you don#t always fill your email into "summary"?
[NEW]: david@grudl.com is not very helpful
Previous Comments:
------------------------------------------------------------------------
[2020-04-10 17:07:50] requinix@php.net
The recursion doesn't have to be fatal: personally, I would rather have the functions warn that
there was a recursive structure and then continue on.
------------------------------------------------------------------------
[2020-04-10 16:24:20] david at grudl dot com
Description:
------------
Operator === and a lot of native functions (such as in_array, array_search(), ...) can cause fatal
error. Example:
$foo = [];
$foo[] = [ &$foo ];
array_search($foo, $foo);
Problem is that this fatal error cannot be catched in try ... catch block. It would be nice if Error
was thrown instead.
(related to #62171)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79466&edit=1
Thread (7 messages)