php

  • The 5.5 exception that renders itself

    Custom exceptions have always had to be translated into a response somewhere in the handler, which turns one file into a growing chain of instanceof checks. 5.5 lets…

  • A circuit breaker before the third-party outage

    A payment provider was slow and the whole site went down with it. A timeout bounds one request; it does nothing about how many are waiting at once.

  • Argument count errors are their own exception

    Calling a userland function with too few arguments used to be a warning that let execution continue with the parameter unset, which turned a call-site mistake into a…

  • Nullable types finally have syntax

    PHP 7.0 gave return types and no way to say a method might legitimately return nothing, so anything that could miss simply went untyped. 7.1 adds a leading…

  • Format bytes as a human readable size in PHP

  • sodium in core replaces the extension nobody installed

    Modern cryptography in PHP has meant either openssl with a lot of decisions to get wrong, or a PECL extension nobody had. 7.2 puts libsodium in core, with…

  • OPcache is per-process-pool, not per-server

    Two PHP-FPM pools have two separate OPcache shared memory segments, so a cache reset in one does nothing to the other — and the site serves a mix…

  • Mailable classes and why the view is not the email

    An email assembled in a controller — subject here, view there, attachments in a third place — cannot be tested without sending it, and the subject line ends…

  • Designing an API two mobile clients can live with

    Two apps, two release cycles, and neither can be forced to update. What is additive, what is not, and the decisions that have to be made before the…

  • void says the return value is not the point

    A method that exists for its effect has always returned null implicitly, which means a caller assigning its result gets something rather than an error. void makes the…