php

  • random_int, never rand, for anything that matters

    rand and mt_rand are seeded generators whose output is predictable from a small number of samples, and they are still the first result for “php random number”. The…

  • readonly plus a wither means a constructor call

    clone copies the initialised state of a readonly property, so modifying the copy throws and every wither has to construct a new instance. The verbosity compounds: a value…

  • Flysystem 3 returns false less and throws more

    The filesystem abstraction moved from returning false on failure to throwing, and Laravel 9 wraps that in a setting rather than a change. Defaulting to the old behaviour…

  • Forced scoping on a nested route binding

    A nested route binding resolved both models independently, so a request for one customer’s order under another customer’s URL returned the order. The unscoped behaviour is an authorisation…

  • Laravel 9 moved to Symfony 6 and took PHP 8 with it

    February, the first annual major, and a version number that means less than it used to. The work is two packages that block everything.

  • Testing a block theme without a browser

    A theme with no PHP has nothing a unit test can call, and the only test is a person looking at a page.

  • Laravel 9 accessors are one method rather than two

    February’s release replaces the get-and-set method pair with a single method returning an Attribute object. The old syntax still works and is not deprecated, so this is an…

  • Elasticsearch 8 turns security on and removes types

    February, and a major that changes the default posture rather than the API. The cluster starts and nothing can connect to it.

  • Intersection types cannot be nullable until 8.2

    Pure intersection types in 8.1 mean class and interface types only, which excludes the nullable case that most signatures need. The restriction to class types is what “pure”…

  • An audit log that a lawyer could read

    A dispute, and a log that recorded that something changed. “Order updated” with no before, no after and no actor.