# Install Composer: https://getcomposer.org
composer init # start a project interactively
composer require guzzlehttp/guzzle # add a package
composer require --dev phpunit/phpunit
# Installs into vendor/ and writes composer.json + composer.lock
# (commit both json and lock; ignore vendor/)
<?php
// One require gives you every installed package + your own classes:
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get('https://api.github.com/users/octocat');
$data = json_decode($response->getBody()->getContents(), true);
echo $data['name'];
The ecosystem's center of gravity is Laravel — a full-featured web framework with an ORM, routing, queues, auth, and famously good documentation. Symfony is the other giant, more modular and the foundation many tools build on. WordPress is its own universe: older-style PHP, but half the freelance web market.
# Try Laravel:
composer global require laravel/installer
laravel new blog
cd blog
php artisan serve # dev server at localhost:8000
# Useful quality tools:
composer require --dev phpstan/phpstan # static analysis
./vendor/bin/phpstan analyse src --level=8