我有以下 php 代码:
function mapWordsToOriginal()
{
try
{
$d = array();
function map_FilteredWithOriginal($n, $m)
{
return(array(($n + 1) => ($m + 1)));
}
foreach ($this->wordsArray as $word)
{
array_push($d, array_map(
"map_FilteredWithOriginal",
array_keys(
$this->wordsArray, $word),
array_keys($this->originalText, $word)));
}
for ($i = 0; $i < count($d); $i++)
{
for ($j = 0; $j < count($d[$i]); $j++)
{
$this->mapFilteredWithOriginal +=$d[$i][$j];
}
}
if ($this->debug)
{
print_r($this->mapFilteredWithOriginal);
}
}
catch (Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
我使用了这个函数几次(取决于文本的长度),但是当我第二次进入这个代码时:
function map_FilteredWithOriginal($n, $m)
{
return(array(($n + 1) => ($m + 1)));
}
脚本刚刚停止。
我不知道为什么,也没有发现异常......