Looking at projects such as Rails Panel, ChromePHP, PHP-Console, and FirePHP:
They all seem to use headers in the HTTP response to add items to the developer tools console (or equivalent).
Would it be possible to do this with the stock install of the developer tools? no need to install extra extensions.
So from PHP, you could call something like:
header('X-Console-Log: Some message');
header('X-Console-Log: Another message', false);
header('X-Console-Error: Debug dump', false);
Or perhaps something could be done with JSON and a single header?
header('X-Console: ' . json_encode(...)); // See note below
I think the developer tools will then just need to look for the header(s), and add it to the console.
Although it will probably be a good idea to also have some kind of filter, so you can see only the JavaScript, network (e.g.404 / CSP type errors), or those from the servers response headers.
---
Note: the output from the json_encode() function might need to be escaped for the header (not sure if a newline character will get out of it).