php

  • Composer scripts see vendor/bin on the path

    Scripts in composer.json run with vendor/bin prepended to PATH, so the tools do not need a path prefix — which is why “test”: “phpunit” works and the same…

  • Collections: pipe and tap keep a chain readable

    A collection chain reads well until it needs one step that is not a collection method — a log line, a total computed from the whole set —…

  • Throwable catches what catch (Exception) missed

    PHP 7 turned most fatal errors into thrown objects, but they do not extend Exception — they extend Error, and both implement Throwable. Every existing catch (Exception $e)…

  • Redis beyond caching: locks, counters and rate limits

    The cache server was already there doing one job out of four. A lock that expires, a release that checks it still owns the lock, and a sliding-window…

  • yield from delegates without a loop

    Composing generators without yield from means a wrapper loop that yields each item from the inner one, which works and costs a function frame per item on top…

  • composer validate belongs in CI

    A composer.json edited by hand and a lock file regenerated on a different machine drift apart quietly, and the first symptom is usually a deploy installing something nobody…

  • Laravel 5.3 notifications unified the channels

    Sending the same event by email, SMS and a database record meant three call sites and three formats to keep in step. 5.3 makes the notification one class…

  • Laravel 5.2 middleware groups replaced the kernel list

    Before 5.2 the HTTP kernel had one global middleware stack, so anything needed by web routes also ran for API routes — sessions, CSRF verification and cookie encryption…

  • A deployment pipeline that runs the tests first

    Deploying by rsync on a Friday afternoon, and what replaced it: lint, test, build, stage, promote — with a rollback that is the same mechanism rather than a…

  • preg_replace_callback_array for several patterns at once

    Applying several regular expressions with different callbacks meant chaining preg_replace_callback() calls, each re-scanning the whole subject — three patterns, three passes. Patterns are applied in the order given…