ccampbell / chromephp

class for logging PHP variables to Google Chrome console
http://www.chromelogger.com
1.38k stars 450 forks source link

arrays displayed as objects #19

Closed llbbl closed 11 years ago

llbbl commented 12 years ago

when I var_dump the variable is an array, but I dump it to ChromePhp it says it is an object.

anyone notice this?

ccampbell commented 12 years ago

This is because PHP arrays can be arrays or hash tables. If you log ChromePhp::log(array(1, 2, 3)); I believe it will show up in the console as [1, 2, 3] (an array), but if you log ChromePhp::log(array('test' => 1); It will show up as an object because in Javascript this is an object/dictionary.

ccampbell commented 11 years ago

Closing this out since it is not a bug.