Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8502 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70113 invoked by uid 1010); 13 Mar 2004 13:28:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 70089 invoked by uid 1007); 13 Mar 2004 13:28:26 -0000 Message-ID: <20040313132826.70088.qmail@pb1.pair.com> To: internals@lists.php.net Date: Sat, 13 Mar 2004 07:28:49 -0600 User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5b) Gecko/20040228 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 24.171.96.14 Subject: Infinite loop From: guru@php.net (Joe Estock) I know that this would most likely never be used, however someone brought this to my attention and I have verified it on PHP 4.3.4 on FreeBSD 5.2.1-RELEASE as well as PHP 4.3.4 on Windows XP. --- while(str_replace(' ', ' ', ' f dfd 34 dsf ')) { } --- This results in PHP obviously becoming stuck in an infinite loop. The semantecs of it make complete sense, str_replace will always return TRUE. My question is this: Shouldn't there be some type of detection for this that would at least cause PHP to throw a warning? Regards, Joe Estock (guru)