Bug#359064: [php-maint] Bug#359064: php4-cli: crashes when a script
includes itself
Adam Conrad
adconrad at 0c3.net
Mon Mar 27 00:37:54 UTC 2006
Ulf Harnhammar wrote:
>
> <?php
>
> include('phpcrash.php');
>
> ?>
> metaur at metaur:~/ulf$ php4 -q phpcrash.php
> Segmentation fault
This, of course, causes an infinite loop. While php4 shouldn't be
segfaulting here (it looks like php5 just goes on for a while, and then
errors out with a memory allocation error, depending on what your memory
limit is set to in php.ini), you really shouldn't be creating these
loops in the first place. :)
If you want PHP to use include refcounting and not include a file more
than once, you probably want to use include_once/require_once in many
places where you'd be inclined to use include/require.
... Adam
More information about the pkg-php-maint
mailing list