Javascript | C | PHP | |
|---|---|---|---|
| Type | embedded, server-side web | compiled | server-side web, scripting |
| Paradigm | object-oriented, imperative, functional | procedural, structured | imperative, object-oriented, procedural, reflective |
| Typing | dynamic, weak, duck | static, weak, manifest, nominal | dynamic, weak |
| Syntax Style | C; symbol-delimited blocks | symbol-delimited blocks | C; symbol-delimited blocks |
| Safety | bounded arrays | unsafe pointers, unbounded arrays | bounded arrays |
| Data Structures | lists, objects (usable as maps) | fixed arrays, unions, records | unified list/map, objects |
| Object Orientation | prototype-based classes | single-inheritance rooted classes, interfaces | |
| Namespaces | emulated | no | yes |
| Unicode | yes (excluding regex) | separate multibyte type, but no Unicode handling. Use ICU or iconv. | optional (special functions) |
| Threading | yes (IE10+, web workers) | 3rd party | 3rd party (pthreads) |
| Garbage Collection | yes | 3rd party | yes |
| Assembly | inline/linked Inline support depends on compiler and architecture. It is supported on GCC, Clang, and VC++/x86. | ||
| Library Support | C | C interpreter extensions | |
| Popular Implementations | SpiderMonkey, V8, JavaScriptCore, Chakra | Visual C++, GCC, Clang, Intel | Zend Engine, Phalanger, Quercus, WebSphere sMash, HipHop for PHP |
| Standard | ISO, ECMA | ANSI, ISO | reference implementation |
| "Hello, world" | inserted into webpage: alert("Hello, world"); | #include <stdio.h> int main(void) { puts("Hello, world"); return 0; } | <?php echo "Hello, World"; ?> |