The key type changing is generally not a problem per se, but it's definitely odd with the default re-indexing behaviour depending on whether something is integer keys only or not. That's exactly what I've been…
Arrays in PHP are mostly confusing if you are used to them in other languages. Instead of $array[0] - the first element is accessed via array_first(). Having them as key-value means, that you can easily just remove some…
C# 13 has this via the field keyword (as preview feature): https://learn.microsoft.com/en-us/dotnet/csharp/language-ref... It's pretty similar to what PHP provides here, except that PHP uses "$this->propname =" and C#…
While variable-length lookbehind is surely more comfortable to work with, I found clever usage of \K to be largely sufficient in most cases. But I agree, a great feature!
readonly is rather a misnomer for "writeonce" in PHP. And as such it also disallows repeated assignment in class scope, while private(set) has no such restriction.
array_find parameter ordering is modeled after other non-variadic array functions, e.g. array_filter also having ($array, $callback) order. But I agree, there is already some inconsistency, and when adding a new…
I found this approach works best with languages having method overloading. For PHP it felt quite limiting, and it also requires you to have more complexity and overhead with wrapping. But I have no hard evidence at…
One of the main advantages of actually allowing more arguments is forward compatibility: You can, within a library, provide an additional argument to a callback without actually introducing a BC break for all users. My…
The key type changing is generally not a problem per se, but it's definitely odd with the default re-indexing behaviour depending on whether something is integer keys only or not. That's exactly what I've been…
Arrays in PHP are mostly confusing if you are used to them in other languages. Instead of $array[0] - the first element is accessed via array_first(). Having them as key-value means, that you can easily just remove some…
C# 13 has this via the field keyword (as preview feature): https://learn.microsoft.com/en-us/dotnet/csharp/language-ref... It's pretty similar to what PHP provides here, except that PHP uses "$this->propname =" and C#…
While variable-length lookbehind is surely more comfortable to work with, I found clever usage of \K to be largely sufficient in most cases. But I agree, a great feature!
readonly is rather a misnomer for "writeonce" in PHP. And as such it also disallows repeated assignment in class scope, while private(set) has no such restriction.
array_find parameter ordering is modeled after other non-variadic array functions, e.g. array_filter also having ($array, $callback) order. But I agree, there is already some inconsistency, and when adding a new…
I found this approach works best with languages having method overloading. For PHP it felt quite limiting, and it also requires you to have more complexity and overhead with wrapping. But I have no hard evidence at…
One of the main advantages of actually allowing more arguments is forward compatibility: You can, within a library, provide an additional argument to a callback without actually introducing a BC break for all users. My…