Basics
38 entries
Arrays (indexed/associative)
Demonstrates creating and reading indexed arrays and associative arrays (key-value pairs).
Asymmetric Visibility
Public to read, restricted to write — PHP 8.4 public private(set) against read/write splits in 10 languages.
Attributes and Annotations
How metadata is attached and who reads it — PHP 8 Attributes surveyed across 10 languages.
Autoloading
Demonstrates on-demand class loading; Go and Rust resolve everything statically at compile time and have no runtime autoloading.
Variables and types
Demonstrates variable declaration and basic data types: integers, strings, and floats.
Closures and anonymous functions
Demonstrates closures capturing outer variables; Java expresses them with lambdas, Rust through its three Fn capabilities.
Closure Binding
Who owns the call's context — Closure::bind against rebinding this/the receiver across 10 languages.
Constructor Property Promotion
Who writes the boilerplate for you — PHP 8.0 constructor promotion against parameter-to-field shortcuts in 10 languages.
Array Value Semantics and Copy-on-Write
What assignment actually does — PHP array value semantics and COW against array assignment in 10 languages.
Enumerations (Backed Enums)
PHP 8.1 backed enums: value/name/lookup versus enum models across 10 languages; Rust variants can carry data.
Exceptions (try/catch)
Throws and catches an exception, printing the caught message.
Fibers
Suspending the whole call stack or just one frame — PHP 8.1 Fiber against the concurrency-primitive spectrum of 10 languages.
First-Class Callables
Functions as values — PHP 8.1's `...` syntax against passing behavior as data in 10 languages.
foreach by Reference
as &$v writes straight into the array — PHP foreach by reference against traversal write-back in 10 languages.
Function definition and call
Defines a function that returns a string and calls it.
Generators
Demonstrates lazy sequence generation; Go approximates it with channels plus goroutines, Java with Streams, Rust with iterators.
Generators and Lazy Evaluation
Are values produced on demand or precomputed — PHP's lazy yield taught across 10 languages and four schools.
if/else conditionals
Demonstrates multi-branch conditionals with if / else if / else.
Integer Overflow
The outlier that promotes to float — PHP integer overflow surveyed against overflow strategies in 10 languages.
Lazy Objects
State initializes on first touch — PHP 8.4 lazy ghosts and proxies against deferred initialization in 10 languages.
Loops (for/foreach/while)
Demonstrates counting for loops, traversal loops (foreach/range/for...of), and while loops.
Magic Methods and Metaprogramming
Trigger paths of __get/__set/__call/__toString/__invoke, beside Python dunders, JS Proxy and Rust traits as metaprogramming entries.
match expressions
Compares switch and match; PHP match uses strict comparison, Rust match checks exhaustiveness at compile time.
Pattern Matching and Exhaustiveness
Expression or statement, exhaustive or not — PHP match surveyed across 10 languages on two dimensions.
Named Arguments
Position or name — PHP 8.0 named arguments versus how 10 languages pass parameters.
Namespaces and use
Demonstrates namespace organization and importing; each language maps the concept to modules or packages.
Namespaces and Module Systems
PHP namespace/use resolution and aliasing, surveyed against Go, Java, Rust, Python and JS module systems; links to spl_autoload_register.
Nullsafe Operator (?->)
Is null a type or a value — PHP ?-> chain short-circuiting beside C# ?., JS ?., Rust Option and Java Optional.
Operators
Demonstrates common operators: arithmetic, integer division, and modulo.
Partial Function Application
PHP 8.6's `?` placeholder — a call expression with holes returns a Closure that only runs once the remaining arguments arrive, contrasted with fixing some arguments in 10 languages.
Property Hooks
Properties whose reads and writes run code — PHP 8.4 property hooks against accessors across 10 languages.
Readonly Properties
The immutability spectrum — PHP 8.1 readonly versus how 10 languages block reassignment, and when.
Reference Variables
Is & an explicit alias or implicit sharing — PHP reference variables against the reference models of 10 languages.
String Value Semantics
Who changes after assignment — PHP string value semantics against string mutability in 10 languages.
String interpolation
Embeds variables into a string to build a complete sentence.
Typed Properties
Who catches the bad type first — PHP 7.4 typed properties against the core runtime-versus-compile-time check across 10 languages.
Union Types
Whether 'or' lives in the type or in the branches — PHP 8.0 union types against the type-system expressiveness of 10 languages.
Weak Maps
Whether entries follow the object or the map — PHP 8 WeakMap against GC-cooperative caching in 10 languages.