ID: 43229
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Verified
Bug Type: Reproducible crash
Operating System: CentOS
PHP Version: 5.2CVS-2007-11-09 (CVS)
New Comment:
if you use a different var name like $tmpkeyword instead of
$thiskeyword - it works... ;)
Previous Comments:
------------------------------------------------------------------------
[2007-11-09 23:07:02] [EMAIL PROTECTED]
Looks like a problem happens because array is modified while array_walk
is walking it.
------------------------------------------------------------------------
[2007-11-09 20:45:28] [EMAIL PROTECTED]
Description:
------------
strace doesnt output anything - it just cuts the output with a
segfault.
if you change the variable from $thiskeyword to something else without
"this" at the start, it works correctly... ;)
Reproduce code:
---------------
<?php
$stopwords = array( 'this', 'a', 'the', 'is' );
$keyword = explode( ' ', 'this is a big problem' );
for( $i = 0; $i < 1000; $i++ ) {
$thiskeyword = $keyword;
array_walk( $thiskeyword, create_function('$v,$k','global
$thiskeyword,$stopwords;if(in_array($v,$stopwords)){unset($thiskeyword[$k]);}'));
}
?>
Actual result:
--------------
Segmentation Fault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43229&edit=1