Uncategorized

  • 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…

  • useMemo is a hint and not a guarantee

    React may discard memoised values to free memory, so useMemo is a performance optimisation and never a correctness mechanism. The documentation is explicit that a future version may…

  • Certificate expiry as a metric, not a calendar reminder

    A calendar reminder is a person, and a person on holiday is an outage; days-to-expiry as a metric is an alert like any other. earliest_cert_expiry across the chain…

  • Covered code MSI is the number that means something

    Three mutation metrics are reported and two of them mostly restate line coverage. Setting a threshold on covered MSI and none on the others is what stops the…

  • 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…

  • The cleanup function runs before the next effect too

    Cleanup is not only an unmount hook — it runs before every re-run of the effect, which is what makes a subscription with changing dependencies correct. The ordering…

  • A watcher with immediate is a computed you should have written

    A watcher that runs immediately and assigns to another ref is deriving a value, which is what computed is for and does better. The computed version tracks its…

  • A game day is how you find out the runbook is wrong

    A runbook is correct at the moment it is written and decays silently, and the only way to test it is to follow it. The findings are always…

  • A value object is not an entity and the difference is identity

    Two entities with identical fields are different things; two value objects with identical fields are the same value. The practical consequence is that value objects need no table,…