Problem with function return and includes?
| From: | Karl Pielorz | Date: | Fri, 04 Jun 1999 21:21:06 +0000 |
| Subject: | Problem with function return and includes? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1286@lists.php.net to get a copy of this message | ||
Hi All,
I seem to have run into a problem with PHP4/Zend (This works fine with
PHP3)...
I have a function defined in a file that I include (for this example, it's in
a file called "test2.php", thus:
(test2.php)
"
<?
function reform( $Number ){
return( number_format( $Number, 0, ".", "," ) );
}
?>
"
If you use the above function in the same file it's defined in, it works.
However, if I include the above file, in another file, thus:
(test.php)
"
<?
include "test2.php";
printf( "<P>Name: %s - %s</P>", "karl", reform( 123456 ) );
?>
"
It kills httpd on the "printf" line, i.e.
"
[Fri Jun 4 23:13:18 1999] [notice] child pid 14874 exit signal Segmentation
fault (11)
"
(The client just spirals into death waiting for output which is never sent
from the server)
I can't seem to get any more info out of apache/php4/zend as to where the
problem is (I'm pretty sure I've uncommented the 'signal' handling code that
was disccussed in the list a while ago).
PHP3 with exactly the same setup behaves as expected, i.e. both ways (with the
'reform' function included, and used in the same file it's defined) work.
I realise the above isn't a lot to go on, if anyones got any suggestions as to
how I can snoop around further? (I'm not an expert on debugging etc, but I get
by... usually... :)
Setup is FreeBSD 4.0-Current.
Thanks,
-Karl