Bug #74158 [Nab]: closes connection abruptly

From: Date: Thu, 30 Sep 2021 13:52:57 +0000
Subject: Bug #74158 [Nab]: closes connection abruptly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236941@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74158&edit=1 ID: 74158 Updated by: cmb@php.net Reported by: teo8976 at gmail dot com Summary: closes connection abruptly Status: Not a bug Type: Bug Package: Apache2 related Operating System: linux PHP Version: 5.6.30 Assigned To: cmb Block user comment: N Private report: N New Comment: <https://3v4l.org/PYPvd> (PHP 7.4.0-7.4.2 is irrelevant) Previous Comments: ------------------------------------------------------------------------ [2021-09-30 13:41:28] php4fan at gmail dot com > This is infinite recursion, and should trigger > an out of memory condition And it does not. That is the bug. ------------------------------------------------------------------------ [2021-09-29 15:51:43] cmb@php.net This is infinite recursion, and should trigger an out of memory condition (if you have a memory_limit set). Anyhow, not a bug in PHP, but rather in your script. ------------------------------------------------------------------------ [2017-02-23 23:26:27] teo8976 at gmail dot com Even this one, much simpler! <?php function test(&$x) { test($x); } $a=array(); test($a); Is this the same as https://bugs.php.net/bug.php?id=72568 ? ------------------------------------------------------------------------ [2017-02-23 23:20:09] teo8976 at gmail dot com Here's a PHP script that will systematically reproduce the issue: <?php function fetch_product_dependencies($productid, &$dependency_list) { if (!is_array($dependency_list["$productid"])) { return array(); } $list = array(); foreach ($dependency_list["$productid"] AS $subproductid) { // only traverse this branch if we haven't done it before -- prevent infinte recursion if (!isset($list["$subproductid"])) { $list["$subproductid"] = $subproductid; $list = array_merge( $list, fetch_product_dependencies($subproductid, $dependency_list) ); } } return $list; } $dl=array( 'a'=>array('b', 'c'), 'b'=>array('c', 'd'), 'c'=>array('a'), ); print_r(fetch_product_dependencies('a',$dl)); ------------------------------------------------------------------------ [2017-02-23 22:56:10] teo8976 at gmail dot com ERRATA: curl 'https://www.mydomain.com' -H ...... should read: curl 'https://www.mydomain.com/path/to/some/script.php' -H ...... ------------------------------------------------------------------------ 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=74158 -- Edit this bug report at https://bugs.php.net/bug.php?id=74158&edit=1

« previous php.bugs (#236941) next »