There is a new tutorial about debugging PHP with the help of Javascript on Zend [1] and via a usercomment I came across just another similar implementation [2].
[1] http://www.zend.com/zend/tut/tutorial-DebugLib.php
[2] http://dev.izibox.isa-geek.org/NiceDebug/