Yes,
There are Java, JS, PHP, CSS, and HTML "minifiers".
For example, when you use Google GWT Java for programming, the code is generated as a minimization of JS.
They use the term compiler, but it is not correct. Compilers turn one human readable language code into a object code that only interpreters or machines can read. What this google tool does is to optimize your code so it can be read faster by the interpreter. Script languages needs interpreters to be executed. Programs compiled into machine language are executed faster than any interpreter could. But of course that any program speed depends on it's execution flow project and the experience of the developing team.
New:
Have you tryed to make your JavaScript codes in a specialized IDE?
If you're looking for type cheking, you could try one of these:
- NuSphere PhpED Professional v7 (best)
- phpDesigner 8
- Aptana Studio
- Zend Studio
- DreamWeaver CS6
They have a greater support now, not only for PHP, but for JavaScript, with Code Auto-Complete, Type Verification, Dynamic Syntax Highlighting, Multiple Language Syntax Highlighting and Oriented Object Analysis and Auto Complete as you type.