Side-by-side, interactive cheatsheets for PHP programmers
comparing PHP to other languages. Every example runs live in your browser — no
setup, no installation.
Choose your own path by reordering languages
The web backend, recompiled. A PHP developer reaches for Go when a request handler needs to be a fast, concurrent, single static binary — trading dynamic typing and per-request scripts for a compiler, goroutines, and errors-as-values.
null surprises, no type jugglingif err != nil — there are no exceptions for ordinary failuresimplements; visibility is set by capitalizationThe other half of the web you already half-share. A PHP developer knows JavaScript exists in every browser; this is the leap to using it as a real language — one runtime, an event loop instead of per-request scripts, and an async model PHP has no equivalent for.
async/await — non-blocking I/O and concurrent work, where PHP blocks and runs each request freshnumber type and + overloaded for concat — 5 + "3" is "53", unlike PHP's separate . operatornull and undefined, where PHP has only null=== with coercion rules that differ from PHP's == — your juggling intuition does not transferthis depends on how a method is calledThe other dominant dynamic language — and PHP's closest peer. Python keeps the gradual typing and quick-iteration feel you know, but trades $ sigils, semicolons, <?php tags, and one all-purpose array for significant whitespace, distinct list/dict/tuple/set types, and comprehensions.
$ on variables, no semicolons, no <?php — significant whitespace defines blocks[n*2 for n in items] — replace array_map / array_filter== with no type juggling and no ===; is only for identity. and an explicit self instead of -> and implicit $thisvendor/The language a PHP developer already half-knows. Ruby shares PHP's dynamic typing, heredocs, and => hash syntax, but drops the $ sigils and global function soup for a model where everything is an object — the language behind Rails, and the inspiration for much of modern Laravel.
$ sigils and no <?php tag — a file is Ruby from the first byte; bare names are variables.upcase or .length on the value itself instead of reaching for global strtoupper()/strlen()array.map { ... } and each replace foreach and standalone array_map/array_filternil and false are falsy — 0 and "" are truthy, and == never juggles types the way PHP's loose == doesmodule with include Comparable or Enumerable works like a trait but composes through the method-lookup chainThe machine underneath the web. PHP itself is written in C — this is the leap from a garbage-collected, dynamically typed scripting language down to manual memory, raw pointers, and a compiler that checks every type before the program runs.
malloc/free with no garbage collector; what a PHP variable hides\0 — no string object, no .length, size buffers yourself== that compares addressesDemanding but deeply rewarding, Rust proves memory safety and bare-metal speed aren't in opposition.
Gradual typing, taken further. PHP 8 gave you type declarations, union types, ?->, and ?? — TypeScript is that same instinct made structural and checked by a real compiler, sitting on top of the JavaScript runtime (one number type, ===, an event loop).
number | string) and nullable types — the same idea as PHP 8's int|string and ?stringimplements clause<T>) and typed collections, where PHP has only @template docblocksnumber type, both null and undefined, and built-in async/awaitThe language modern PHP keeps borrowing from. Match expressions, backed enums, named arguments, nullable types, readonly, first-class callables, string interpolation, and #[Attributes] all came to PHP from C# — so much of C# will feel like coming home, now compiled and statically typed.
??, ?., and #[Attributes] — features PHP 8 adopted straight from C#Where/Select/GroupBy chains that read left-to-right, replacing nested array_map/array_filterinit-only properties — value equality and immutability beyond PHP's readonly__get/__set magic methodsasync/await and Task.WhenAll — concurrency PHP needs Fibers or Swoole forThe enterprise backend PHP is so often weighed against. Java is statically typed, compiled to JVM bytecode, and object-oriented to the core — no top-level code, a main class, explicit types everywhere — trading PHP's quick-script feel for generics, streams, records, sealed types, and a checked-exception contract.
main method is the entry pointmixed and @template docblocksfilter/map/collect) in place of array_map/array_filter== vs .equals(), Integer caching, and NullPointerException