php

  • A finally block that returns swallows the exception

    The return expression is evaluated before finally runs, and the value is not handed to the caller until afterwards — so a finally that returns wins, silently. A…

  • A PHPStan extension for a magic method

    Frameworks built on __call and facades produce hundreds of findings that are all the same false positive, and putting them in the baseline hides real errors of the…

  • Http::retry, and the backoff that is one argument

    Retrying a flaky upstream is a loop, a sleep, an attempt counter and a decision about which failures are retryable — four things that get written slightly differently…

  • Fluent strings, and the helper chain that reads forwards

    A string transformation was a nest of function calls read from the inside out, and the order of arguments differed between them. Reading left to right in the…

  • iterable accepts a generator, which cannot be counted

    Type-hinting iterable is the right choice for anything that consumes a sequence, and it makes two promises the caller has to honour. Accepting iterable is a promise to…

  • A Symfony service that is lazy, and when that matters

    A service injected into a controller is constructed on every request that hits it, including the requests that never call it — and for an expensive constructor that…

  • Redis 6 and the shared password that was everywhere

    One password, six services, and FLUSHALL available to all of them. 6.0 landed in April with users — and the keyspace pattern is where the isolation actually is.

  • array_key_first, and the pointer it does not move

    Getting the first key meant reset() then key(), which moves the internal pointer — so a read had a side effect on an array the caller may still…

  • get_posts is WP_Query with four different defaults

    The two are usually described as interchangeable and they are not: get_posts sets four arguments differently, and three of them change behaviour. suppress_filters is the one that produces…

  • app/Models is optional and worth doing anyway

    8.0 puts models in app/Models by default, and an existing project can move them or not — but the reason to move is not the convention. Forty-one files…