PHP Basics & Global Variables: Scope & Superglobals | DevSense
A comprehensive guide to PHP variable scopes (local, global, static) and all superglobals. Learn best practices, security traps, and PHP 8.1+ restrictions.
A comprehensive guide to PHP variable scopes (local, global, static) and all superglobals. Learn best practices, security traps, and PHP 8.1+ restrictions.
Master functional programming in PHP. Learn closures, arrow functions (7.4+), first-class callable syntax (8.1+), modern array methods (8.4+), and pure functions.
A comprehensive developer's guide to PHP magic methods. Explore constructor property promotion, dynamic property/method overloading, serialization evolution, and the performance and static analysis trade-offs of magic methods.
Master modern Object-Oriented Programming in PHP. Learn encapsulation, inheritance, interfaces, abstract classes, traits, anonymous classes (7.0+), readonly properties (8.1+), readonly classes (8.2+), and asymmetric visibility (8.4+).
PHP 7.0 upgrade guide: scalar type declarations, return types, null coalescing (??), spaceship operator (<=>), anonymous classes, Throwable, CSPRNG, and major BC breaks.
PHP 7.1 upgrade guide: nullable types, void returns, class constant visibility, symmetric array destructuring, iterable pseudo-type, multi-catch, negative string offsets, and BC breaks.
PHP 7.2 upgrade guide: object type hint, parameter type widening, PDO debug dumps, LDAP EXOP, addrinfo sockets API, libsodium—plus BC (count, get_class, object/array casts) and mcrypt removed to PECL.
PHP 7.3 upgrade guide: flexible heredoc/nowdoc, trailing commas in calls, reference destructuring, is_countable, array_key_first/last, JsonException, Argon2id, PCRE2—and BC breaks that affect real code.
PHP 7.4 upgrade guide: typed properties, arrow functions, variance, ??=, spread in arrays, WeakReference, __serialize/__unserialize, OPcache preloading, FFI—and the BC breaks that hit real apps.
Explore PHP 8.0 after 7.4: named arguments, match, nullsafe, attributes, JIT, union types—what breaks, what to rewrite, and runnable examples.
Upgrade guide for PHP 5.3: Master namespaces, late static binding, closures, NOWDOC, Phar, and cycles garbage collection while navigating fatal BC breaks like deprecated ereg and call-time pass-by-reference removal.
PHP 8.2 guide: readonly classes, standalone null/false/true types, DNF types, #[SensitiveParameter], Random extension, dynamic property deprecations, and BC breaks from 8.1.