Weird var_dump behavior

I have the following line of code:

var_dump(array()); 

In one file, it outputs this:

 array (size=0) empty 

In the second file, it outputs this:

 string '<pre class='xdebug-var-dump' dir='ltr'> <b>array</b> <i>(size=0)</i> <i><font color='#888a85'>empty</font></i> </pre>' (length=119) 

Any ideas what causes this in the second file? When I look at the rendering markup source of the second file, I see the following:

 <pre class='xdebug-var-dump' dir='ltr'><small>string</small> <font color='#cc0000'>'&lt;pre class=&#39;xdebug-var-dump&#39; dir=&#39;ltr&#39;&gt;&#10;&lt;b&gt;array&lt;/b&gt; &lt;i&gt;(size=0)&lt;/i&gt;&#10; &lt;i&gt;&lt;font color=&#39;#888a85&#39;&gt;empty&lt;/font&gt;&lt;/i&gt;&#10;&lt;/pre&gt;'</font> <i>(length=119)</i> </pre> 

UPDATE 1: view -> source of first file:

 <pre class='xdebug-var-dump' dir='ltr'> <b>array</b> <i>(size=0)</i> <i><font color='#888a85'>empty</font></i> </pre> 
+4
php xdebug
Mar 27 '13 at 18:44
source share
1 answer

var_dump() is replaced by the Xdebugs user-defined function, as indicated here:

Xdebug replaces the PHP function var_dump () to display variables. The Xdebug version includes different colors for different types and limits the number of array elements / properties of the object, the maximum depth and length of the string. There are several more functions associated with variable display.

http://xdebug.org/docs/display

Guess that you are somehow / where you are implementing xdebug in the second file.

+3
Mar 27 '13 at 18:48
source share



All Articles