barbushin / php-console

Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome
https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef
MIT License
1.34k stars 283 forks source link

Do not convert array to object #76

Closed Polfo closed 9 years ago

Polfo commented 9 years ago

Thanks for all your investment in this barbushin

$xx = [1,2];
PC::debug($xx, 'numeric');
$xx = [1=>1,'b'=>'b'];
PC::debug($xx, 'associative');

is displayed as: image

Object {1: "1", b: "b"} is confusing to me, I would expect something consistent with the first display like [1: "1", "b": "b"]

Maybe it is not possible due to a conversion to javascript, but then it would be nice if it was documented.

barbushin commented 9 years ago

There is no way to fix it. It's default behavior of JavaScript console.log() method.