php

  • Named arguments through an interface are a gamble

    PHP does not require an implementation to use the same parameter names as the interface it satisfies, so a named argument through an interface type is only as…

  • A queue worker that stops cleanly

    A deploy killed a worker mid-job and a customer was charged without an order. SIGTERM, a grace period that was too short, and the job that must be…

  • realpath_cache_size, on a codebase with ten thousand files

    PHP caches resolved paths and the default size is small enough to thrash on a modern dependency tree. Every miss is a stat syscall, and a framework autoloading…

  • SplObjectStorage as a set, before WeakMap existed

    SplObjectStorage is a set of objects with O(1) membership, and it holds a strong reference to everything in it. It is genuinely the right tool for cycle detection…

  • str_contains does not accept an array, and never will

    str_contains takes one needle, deliberately, and the array version everybody wants was rejected during the RFC. The argument against an array form was ambiguity — any or all…

  • Xdebug 3 renamed every setting you knew

    Xdebug 3 replaced half a dozen independent toggles with one mode setting, and most documentation still describes the 2.x names. The port change from 9000 to 9003 is…

  • A deadlock is normal; retrying is your job

    InnoDB detects a deadlock, kills one transaction and returns an error, and an application that treats that as a bug will treat a normal event as an outage.…

  • match is not switch, and the three differences

    switch compares loosely, falls through by default and is a statement rather than an expression, and all three of those have produced bugs in code that looked correct.…

  • Union types, and the ones that still cannot be expressed

    A method returning either a Product or an Error had no signature that said so, and the docblock describing it was checked by a static analyser and by…

  • Named arguments and attributes change how a framework is written

    Two 8.0 features that look like syntax and are not. One makes optional parameters part of the API; the other makes docblocks executable.