Type Conversion and Type Coercion in PHP
A practical look at PHP type conversion and coercion: gettype, settype, var_dump, and why strict_types belongs in every file.
Tag
Building applications with PHP: language features, versions and practices. (Page 5/9)
There are 49 posts with this tag.
A practical look at PHP type conversion and coercion: gettype, settype, var_dump, and why strict_types belongs in every file.
How we represented fixed value sets before PHP 8.1 introduced native enums, and the trade-offs of each approach.
PHP 8.0 is out. I share how I've been using attributes and the nullsafe operator in real projects, and what they've actually delivered.
PHP 8.0 isn't out yet, but the RFCs and beta releases are already readable. Here are my notes on three key features worth understanding before release.
A practical guide to PHP exceptions and error handling: try-catch-finally blocks, multiple catch clauses, custom exception classes, and global handlers.
PHP 7.4 was released in November 2019. Typed properties and arrow functions significantly strengthen the language's type system and syntax.