The same match over order status appeared in a controller, two Blade templates, a mailer and an exporter, and adding a case updated four of the five. Moving…
readonly prevents reassignment of the property and says nothing about what the property points at, which is obvious for objects and surprising for arrays. The array case works…
Enums are final, cannot extend anything and cannot be extended, which removes a set of designs that class constants had allowed. Implementing an interface is what makes an…
A readonly property is not initialised-at-declaration; it is write-once from inside the declaring class, and the difference decides what a wither method can do. The property has no…
void means the function returns nothing and never means it does not return, and the second is information a static analyser can act on. The practical value is…
8.1 on 25 November, and the feature PHP had been simulating with class constants for a decade. A status column holding three spellings of the same thing.
unserialize creates an object without calling the constructor and then writes the properties, which is precisely the thing readonly forbids. Native serialisation is allowed by an explicit carve-out…
Hydrating an enum from a request parameter with from() produced an uncaught ValueError on the first malformed input, which was about nine minutes after deploy. The two methods…
__set is only called for inaccessible or undefined properties, so declaring the property you meant to intercept disables the magic silently. The private case is the one that…