XDebug在没有断点的情况下中断

时间:2016-07-16 20:01:57

标签: php xdebug

我目前正在使用php-debugger进行Atom来调试php项目。出于某种原因,每次我遇到下面代码中的$character[$csv[0][$i]] = $a[$i];时,调试器都会暂停。

$file = KRequest::get('files.file', 'raw');

if(!$file) {
    throw new LibBaseControllerExceptionBadRequest('File is missing');
    return;
}

$csv = array_map('str_getcsv', file($file['tmp_name']));
array_walk($csv, function(&$a) use ($csv) {
    $count = count($csv[0]);
    $character = array();

    for($i = 0; $i < $count; $i++) {            
        $character[$csv[0][$i]] = $a[$i];
    }

    $a = $character;
});
array_shift($csv);

我最初在for循环中有一个断点,但经过一些编辑后,该行已被删除。

我已经尝试清除所有断点,升级Atom并升级php-debugger包无济于事。我唯一的想法是断点仍然保存在某个地方并且卡在那里或者那行代码触发某种通知没有记录到php_error.log。

任何建议都会受到赞赏,因为这会妨碍我调试线路。感谢。

1 个答案:

答案 0 :(得分:0)

这是一个导致XDebug暂停的错误。我试图从数组中获取不存在的索引的值。这必定会导致某种错误,而这些错误未被输出或记录。