Re: [PHP4BETA] 'return' crash on Mac OS X Server with PHP 4.0b3

From: Date: Mon, 14 Feb 2000 15:13:20 +0000
Subject: Re: [PHP4BETA] 'return' crash on Mac OS X Server with PHP 4.0b3
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-10250@lists.php.net to get a copy of this message
A backtrace would be helpful... Shut down apache and start it up with gdb /path/to/httpd run -X hit the page in your webserver, gdb will notice the segfault. Then type bt and submit the output as a bug report. On Sat, 12 Feb 2000, Jon Jensen wrote: > I've gotten PHP 4.0b3 to work with Apache 1.3.11 on Mac OS X Server, but > there's a mysterious bug. With the 'square' function example in the > manual: > > function square ($num) { > return $num * $num; > } > echo square(4); > > It works fine with PHP 3.0.12. But 4.0b3 crashes with a 'document > contained no data' error to the browser. (I've tested it under Red Hat 6.1 > and it works fine in both versions.) However, if I change the code to > this: > > function square ($num) { > $val = $num * $num; > return $val; > } > echo square(4); > > It works fine. > > The only change I had to make to get PHP 4.0b3 to compile under Mac OS X > Server was to change line 232 of php.h from: > > #if (!HAVE_SNPRINTF) > > to > > #ifndef HAVE_SNPRINTF > > I don't know much about the C preprocessor, but it seems to make sense and > another guy who ported 3.0.11 did the same thing. However, maybe that's > the problem. The original code causes a 'parse error', thus the need for a > change. > > Does anyone know why that 'return' isn't working? These also fail: > > return "$j like $b"; > return $j . $b; > > I've never used gdb (or any other debugger) but am willing to learn if > it'll help. > > Jon Jensen > > > -- Chad Cunningham ccunning@math.ohio-state.edu Only 218 days until RSA Patent expiration!

« previous php.version4 (#10250) next »