PHP 7.2 and Modern PHP Habits
What PHP 7.2 introduced and how the direction of the language has shaped my day-to-day coding habits, from type declarations to PSR standards and Composer.
Category
Features, syntax and practices of the PHP, JavaScript, TypeScript, Go and Python languages, with release notes and worked examples. (Page 4/5)
This category has 50 posts.
What PHP 7.2 introduced and how the direction of the language has shaped my day-to-day coding habits, from type declarations to PSR standards and Composer.
What Promises are in JavaScript, how to escape callback hell, and the essential patterns for chaining then/catch and managing async flow.
What closures (anonymous functions) are in PHP, how variable capture with the use keyword works, and practical everyday examples.
PHP 7.1's nullable types and void return type make function signatures more readable and precise, so one glance shows whether a function can return null.
How I use interface definitions and dependency injection in PHP to build loosely coupled classes, illustrated with practical examples.
How I apply SRP, the S in SOLID, to PHP classes with concrete examples, moving beyond abstract theory and asking where it is reasonable to stop splitting.
A practical look at how I use the scalar type declarations and return types introduced in PHP 7, including what strict_types mode changes in practice.
PHP 7.0 was released this week. I share my first impressions on the performance gains, scalar type declarations, and return types.
An introduction to the most impactful ES6 features — let, const, arrow functions, and template literals — with practical examples.
An overview of PHP 5.6's variadic argument support and the ** exponentiation operator, plus constant expressions and importing functions with use.
What each layer of MVC is actually responsible for, what a controller should not do, and how to keep controllers thin by moving logic into the model.
The language-level approach to building large loops without blowing up memory: PHP 5.5 generators and the yield keyword.