php

  • Data providers run before setUp, every time

    A provider that builds its cases from something created in setUp() fails with a null, because every provider in the class runs before any test does — including…

  • list() with keys unpacks an associative row

    Destructuring only worked positionally, so a row fetched as an associative array had to be unpacked by hand — three assignments and a typo waiting to happen. A…

  • withoutOverlapping on a scheduled command

    A scheduled task that occasionally runs longer than its interval will be started again while the first is still going, which for an import means two processes writing…

  • An event-driven seam between two services

    The synchronous call between two services was the reason both were down. Publishing an event decouples their availability — and makes eventual consistency a business decision.

  • Laravel 5.4 dropped the model events you were using

    5.4 removed the string-based model events fired through the event dispatcher — eloquent.saved: AppOrder and its relatives — in favour of an $dispatchesEvents map to real classes. The…

  • composer install –no-scripts on a machine you do not trust

    Composer runs scripts declared by packages during install, which is convenient and means composer install executes third-party code the moment it lands. On a CI runner building a…

  • Signed numeric strings compare differently now

    PHP 7.1 changed how a string with a leading sign is treated in a numeric context, which is a correctness fix and a behaviour change in code that…

  • get_id() rather than ->id, and why it matters

    The getter looks like ceremony over a property and is the entire point of the release: with the read going through a method, where the value comes from…

  • Schema changes that do not need a maintenance window

    An ALTER on a 40 million row table held a metadata lock behind every query. Expand, migrate, contract turns one blocking release into three safe ones.

  • Queue retry_after and the job that runs twice

    The queue worker’s –timeout and the connection’s retry_after are two different clocks, and getting their order wrong is the most common cause of a job silently running twice.…