lgyers / firephp

Automatically exported from code.google.com/p/firephp
0 stars 0 forks source link

Incorrect type of vars dumped #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, I'm using FirePHP with ZendFramework in a smarty-like console for
dumping all variables assigned to the view, so I just dump them in a table.

The problem is that objects or null values are dumped as 'array'.

As an example, I have an object $role, with properties parent and parentId
set to NULL:

object(stdClass)#100 (5) {
  ["roleId"] => int(1)
  ["parentId"] => NULL
  ["parent"] => NULL
  ["role"] => string(5) "Admin"
  ["privileges"] => array(1) {
    [1] => string(3) "all"
  }
}

When I dump it in FirePHP, it looks like this:

array(
 ['roleId']   => 1
 ['parentId'] => array()
 ['parent']   => array()
 ['role']     => 'Admin'
 ['privileges'] => array(
   [1] => 'all'
 )
)

$role is not an array, and there are NULL properties markd as empty arrays.

What I'd like to see is basically the same as in a print_r. Something like
this:

stdClass(
 ['roleId']   => 1
 ['parentId'] => NULL
 ['parent']   => NULL
 ['role']     => 'Admin'
 ['privileges'] => array(
   [1] => 'all'
 )
)

I'm using the latest release (0.1.0.3) in fireox 3.0.1 with the latest firebug.

(FirePHP is now involved in all my projects, I think it's just great.
Congrats Cristoph!!!)

Original issue reported on code.google.com by panqueto...@gmail.com on 19 Jul 2008 at 5:12

GoogleCodeExporter commented 9 years ago
Great to hear you find FirePHP useful.

The problem with the variable typing is that the Zend_Json component as well as 
the
current FirePHPCore.class.php implementation discard the type information when 
the
data is re-formatted into a JSON string.

I need to provide my own JSON encoder that adds additional typing info which I 
have
not done yet as I was trying to re-use what ZF already provides.

I'll put this high up on the priority list as it is obviously something that 
needs to
be addressed.

Thanks for your feedback!

Original comment by christop...@gmail.com on 19 Jul 2008 at 4:52

GoogleCodeExporter commented 9 years ago
Will be fixed in 0.1.0.6

Original comment by christop...@gmail.com on 30 Jul 2008 at 7:12