Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39580 invoked by uid 1010); 1 Sep 2004 12:38:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39452 invoked by uid 1007); 1 Sep 2004 12:37:59 -0000 Message-ID: <20040901123759.39354.qmail@pb1.pair.com> To: internals@lists.php.net Date: Wed, 1 Sep 2004 14:37:55 +0200 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Posted-By: 62.58.68.2 Subject: Very weird behaviour with a neverending recursive function From: r.korving@xit.nl ("Ron Korving") Hi, I've been experiencing very weird behaviour (which I can't seem to reproduce). Nonetheless, I can tell you what happens, and you can decide if this is a PHP5 bug or feature. I wish I could give more information on this, but I can't seem to create a clean situation where this happens. I just hope somebody reads this and goes "Eureka!" or something. I post some text fields to a PHP page. These variables are entered into a function, which calls itself (so it's a recursive function). The idea is that it deletes information from a table, and the records link to eachother (records are child/parent of eachother). I made the mysql query wrong, so that the function ended up calling itself recursively for infinity. The weird thing though, is that my script did not crash, it just stopped functioning when I called this function for the first time (and thereby creating the infinite loop). Now I figure that the infinity is somehow detected so the function won't stall the system until apache is stopped. This isn't the weird thing. The weird thing is, that when this occured, none of the submitted information existed anymore, not even at the start of my script. The idea: submit.php: recursiveFunction($_POST["foo"]); ?> var_dump printed "NULL". submit.php: recursiveFunction($_POST["info"]); ?> var_dump printed array information as it normally would. I can't explain this situation and it just doesn't seem to be preferred behaviour. I hope anyone can do anything with the above information. I can't offer you a perfect example to reproduce this (and I don't have a clue why I can't). Thanks for reading, Ron