PHP’s obituary has been written many times, yet in 2015 it powers roughly 80% of all websites with server-side code — including WordPress, Facebook (via Hack), and Wikipedia. The language has matured dramatically since the PHP 4 days: Composer brought proper dependency management, PSR standards unified coding style across frameworks, and PHP 5.6 added genuinely useful language features.
Composer: The Dependency Manager PHP Needed
Composer, introduced in 2012 and widely adopted by 2014, transformed how PHP projects are structured. Define your dependencies in composer.json and run composer install:
{
"require": {
"guzzlehttp/guzzle": "~5.0",
"monolog/monolog": "~1.0"
}
}
Packagist hosts over 50,000 packages as of 2015. If you are not using Composer, you are building on sand.
PHP 5.6 Features Worth Using
- Variadic functions —
function sum(int ...$nums)replaces manualfunc_get_args(). - Constant scalar expressions — constants can now be defined using expressions, not just literals.
- Argument unpacking —
...$argsspreads arrays into function arguments. - use function / use const — import functions and constants into a namespace cleanly.
Generators: Lazy Iteration Without Memory Overhead
PHP 5.5 introduced generators — functions that yield values one at a time instead of building an entire array in memory:
function xrange($start, $end) {
for ($i = $start; $i <= $end; $i++) {
yield $i;
}
}
foreach (xrange(1, 1000000) as $n) {
// processes one integer at a time — constant memory
}
PSR Standards
The PHP-FIG (Framework Interoperability Group) defines PSR coding standards that major frameworks honour. PSR-2 covers code style, PSR-4 covers autoloading. Following them means your libraries work anywhere Composer is used.
Frameworks in 2015
Laravel 5 (released February 2015) brought Eloquent ORM, Artisan CLI, and Blade templating to a generation of developers. Symfony 2 remained the enterprise favourite. Slim 3 emerged as the micro-framework of choice for APIs. Pick one and go deep rather than framework-hopping.
PHP is far from dead. The PHP 7 announcement — promising 2× performance over PHP 5.6 — means the language is evolving, not stagnating. 2015 is a great time to be a PHP developer.