Using #PHP arrays as pseudo-objects is almost never the right answer. They're less self-documenting, slower, worse on memory, and more bug prone.
peakd.com/php/@crell/php-use-a…
PHP: Use associative arrays basically never | PeakD
The other day I was working on some sample code to test out an idea that involved an object with an internal nested arr... by crellPeakD
Alerta! Alerta!
Als Antwort auf Larry Garfield • • •Great! So let's use an ArrayObject instead!
/me 🦆🏃
Dan Leech
Als Antwort auf Alerta! Alerta! • • •Alerta! Alerta!
Als Antwort auf Dan Leech • • •@dantleech Yeah... and no
They are also.combining the worst of both sides.
A generic object that can contain anything without knowing from the outside....
One *can* use it in awesome ways. But sonfar.most of the time it was used the same way as an associative array. So the only advantage over a real array is that it is an object. That's it. No added type-safety, no predictability, nothing....
/cc @Crell
Dan Leech
Als Antwort auf Alerta! Alerta! • • •Alerta! Alerta!
Als Antwort auf Dan Leech • • •@dantleech 🤣 Sorry for not getting the joke! Well, I kinda got it but it was just too close to.reality...
I sense a need to calibrate my sarkasm sensors.... 🙈
/cc @Crell
Larry Garfield
Als Antwort auf Alerta! Alerta! • • •Tiffany
Als Antwort auf Larry Garfield • • •