【问题标题】:XDebug Breaks at line without breakpointXDebug 在没有断点的行处中断
【发布时间】:2016-07-16 20:01:56
【问题描述】:

我目前正在使用php-debugger for 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 的通知。

任何建议都将不胜感激,因为这会阻止我进行调试。谢谢。

【问题讨论】:

    标签: php xdebug


    【解决方案1】:

    这是导致 XDebug 暂停的错误。我试图从数组中获取不存在的索引的值。这一定是导致了某种没有被输出或记录的错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-31
      • 2014-05-28
      • 2015-09-11
      • 1970-01-01
      • 2017-03-03
      • 2011-04-30
      • 1970-01-01
      相关资源
      最近更新 更多