dpwqicw157673 2017-09-25 14:56
浏览 71

xdebug没有在var转储上打破行

I was using xdebug on my Ubuntu 14.04 with php version 5.6 and everything was fine until, all the sudden, the output of xdebug var_dump started to print everything on one single line, instead of breaking line and identing the code.

This is the html output on response tab of chrome dev tools:

<pre class='xdebug-var-dump' dir='ltr'>
<small>/path/to/source/Controller.php:28:</small>
<b>array</b> <i>(size=1)</i>
  0 <font color='#888a85'>=&gt;</font> 
    <b>object</b>(<i>Application\Entity\Reciimpr</i>)[<i>973</i>]
      <i>protected</i> 'id' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>72403</font>
      <i>protected</i> 'dtimp' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>DateTime</i>)[<i>977</i>]
          <i>public</i> 'date' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'2017-09-25 00:00:00.000000'</font> <i>(length=26)</i>
          <i>public</i> 'timezone_type' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>3</font>
          <i>public</i> 'timezone' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'America/Sao_Paulo'</font> <i>(length=17)</i>
      <i>protected</i> 'usuaimp' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'USER   '</font> <i>(length=10)</i>
      <i>protected</i> 'ipmaquina' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'::1            '</font> <i>(length=15)</i>
      <i>protected</i> 'nume' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>33</font>
      <i>protected</i> 'sisimp' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'NGM'</font> <i>(length=3)</i>
      <i>protected</i> 'ano' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>2017</font>
      <i>protected</i> 'nvias' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>0</font>
      <i>protected</i> 'mvfi' <font color='#888a85'>=&gt;</font> 
        <b>object</b>(<i>Application\Entity\Movifina</i>)[<i>939</i>]
          <i>protected</i> 'id' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>290756</font>
          <i>protected</i> 'tpmv' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>1</font>
          <i>protected</i> 'core' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>DoctrineORMModule\Proxy\__CG__\Application\Entity\Rececont</i>)[<i>996</i>]
              ...
          <i>protected</i> 'parc' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>0</font>
          <i>protected</i> 'caixa' <font color='#888a85'>=&gt;</font> <small>boolean</small> <font color='#75507b'>true</font>
          <i>protected</i> 'fore' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>DoctrineORMModule\Proxy\__CG__\Application\Entity\Formrece</i>)[<i>983</i>]
              ...
          <i>protected</i> 'banco' <font color='#888a85'>=&gt;</font> <font color='#3465a4'>null</font>
          <i>protected</i> 'agencia' <font color='#888a85'>=&gt;</font> <font color='#3465a4'>null</font>
          <i>protected</i> 'conta' <font color='#888a85'>=&gt;</font> <font color='#3465a4'>null</font>
          <i>protected</i> 'numecheq' <font color='#888a85'>=&gt;</font> <font color='#3465a4'>null</font>
          <i>protected</i> 'nparccred' <font color='#888a85'>=&gt;</font> <font color='#3465a4'>null</font>
          <i>protected</i> 'dthoje' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>DateTime</i>)[<i>934</i>]
              ...
          <i>protected</i> 'dtmov' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>DateTime</i>)[<i>935</i>]
              ...
          <i>protected</i> 'cnbc' <font color='#888a85'>=&gt;</font> <small>int</small> <font color='#4e9a06'>1</font>
          <i>protected</i> 'valtotmov' <font color='#888a85'>=&gt;</font> <small>float</small> <font color='#f57900'>2.5</font>
          <i>protected</i> 'princ' <font color='#888a85'>=&gt;</font> <small>float</small> <font color='#f57900'>2.5</font>
          <i>protected</i> 'ipincl' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'::1'</font> <i>(length=3)</i>
          <i>protected</i> 'dtincl' <font color='#888a85'>=&gt;</font> 
            <b>object</b>(<i>DateTime</i>)[<i>936</i>]
              ...
          <i>protected</i> 'usuaincl' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'USER   '</font> <i>(length=10)</i>
          <i>protected</i> 'sisincl' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'NGM'</font> <i>(length=3)</i>
      <i>protected</i> 'status' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'I'</font> <i>(length=1)</i>
</pre>

This is how the preview looks like:

/path/to/source/Controller.php:28:array (size=1)  0 =>     object(Application\Entity\Reciimpr)[973]      protected 'id' => int 72403      protected 'dtimp' =>         object(DateTime)[977]          public 'date' => string '2017-09-25 00:00:00.000000' (length=26)          public 'timezone_type' => int 3          public 'timezone' => string 'America/Sao_Paulo' (length=17)      protected 'usuaimp' => string 'USER   ' (length=10)      protected 'ipmaquina' => string '::1            ' (length=15)      protected 'nume' => int 33      protected 'sisimp' => string 'NGM' (length=3)      protected 'ano' => int 2017      protected 'nvias' => int 0      protected 'mvfi' =>         object(Application\Entity\Movifina)[939]          protected 'id' => int 290756          protected 'tpmv' => int 1          protected 'core' =>             object(DoctrineORMModule\Proxy\__CG__\Application\Entity\Rececont)[996]              ...          protected 'parc' => int 0          protected 'caixa' => boolean true          protected 'fore' =>             object(DoctrineORMModule\Proxy\__CG__\Application\Entity\Formrece)[983]              ...          protected 'banco' => null          protected 'agencia' => null          protected 'conta' => null          protected 'numecheq' => null          protected 'nparccred' => null          protected 'dthoje' =>             object(DateTime)[934]              ...          protected 'dtmov' =>             object(DateTime)[935]              ...          protected 'cnbc' => int 1          protected 'valtotmov' => float 2.5          protected 'princ' => float 2.5          protected 'ipincl' => string '::1' (length=3)          protected 'dtincl' =>             object(DateTime)[936]              ...          protected 'usuaincl' => string 'USER   ' (length=10)          protected 'sisincl' => string 'NGM' (length=3)      protected 'status' => string 'I' (length=1)

Does anyone have any idea why this is happening? I've already tried to purge and install it again via apt-get and pecl, both unsuccessful. :(

Thanks in advance for any help!

  • 写回答

1条回答 默认 最新

  • dousui6193 2017-10-26 11:54
    关注

    What I've found is that you gonna need <pre></pre> between your variable. I've created a snippet to replace 'vardump' with this:

    foreach ($variable as $key => $reg) {
        echo "<pre>{$key} => '{$reg}'</pre>";
    }
    var_dump($variable);die;
    

    Ps: I'm repeating the data with the last var_dump to get the filename and line

    So this: enter image description here Became this: enter image description here

    Let me know if this will help you.

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向