Req #79466 [Opn]: Fatal errors because of recursion should be exceptions

From: Date: Fri, 10 Apr 2020 17:07:50 +0000
Subject: Req #79466 [Opn]: Fatal errors because of recursion should be exceptions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226520@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79466&edit=1 ID: 79466 Updated by: requinix@php.net Reported by: david at grudl dot com -Summary: david@grudl.com +Summary: Fatal errors because of recursion should be exceptions Status: Open Type: Feature/Change Request -Package: Output Control +Package: Arrays related PHP Version: Next Major Version Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#226520) next »