RE: [PHP-DEV] PHP 4.0 Bug #9136: simple script with infinite function calls causes seg fault

From: Date: Tue, 06 Feb 2001 23:28:40 +0000
Subject: RE: [PHP-DEV] PHP 4.0 Bug #9136: simple script with infinite function calls causes seg fault
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-45898@lists.php.net to get a copy of this message
I never said that recursion or the ability for a function to call another function was a feature/bug. I agree that they are necessary to the language. My point is simply that I don't think PHP needs to be "fixed" so that this user's mistake is somehow valid. Take this example (in C): /*******************************************/ #include <stdio.h> int a(void); int b(void); int main(int argc, char **argv) { a(); return; } int a(void) { b(); } int b(void) { a(); } /*******************************************/ If compiled and run this results in a segfault under linux2.2.18 (glibc2). gcc doesn't warn me that this is invalid. I am not really sure what we are arguing at this point... Sean > -----Original Message----- > From: Zak Greant [mailto:zak@nucleus.com] > Sent: Tuesday, February 06, 2001 6:22 PM > To: elixer@erols.com; php-dev@lists.php.net > Subject: Re: [PHP-DEV] PHP 4.0 Bug #9136: simple script with infinite > function calls causes seg fault > > > Sean wrote: > > Dear Zak: > > > > Because I don't consider it a problem that needs solving. > I am probably > > overlooking some notoriously famous algorithm, but I can't > think of a > valid > > reason for such functionality to exist unless someone is > purposely trying > to > > bring a system to its knees. > > I don't think that this is feature (or a bug FTM) - this is > just how things > were implemented - a side effect of needing both recursion > and allowing > functions to call other functions. > > --zak > >

« previous php.dev (#45898) next »