PHP loves its arrays. Arrays are the uber-data structure. They're a list, a map, a stack, a queue, everything in one! Which is the problem.
Modern PHP grossly over-uses arrays. In most cases there are better options today, and when you find yourself reaching for "oh I'll just make this an associative array", stop. An extra 60 seconds of thought and code will often give you a more readable, faster, more memory-efficient, more flexible alternative. Classes, iterables, and collections can and should replace arrays in most of your day to day coding.
This talk will go through what PHP arrays actually are (hint: they are not, in fact, arrays at all), why they're so problematic, and what to do instead. By the end, you should find yourself (almost) never reaching for arrays to solve a problem.
Nashville PHP is a community of PHP and Web developers serving the metro Nashville and Middle Tennessee areas. Everyone is welcome, no matter your skill level. Come learn with us!
About Larry Garfield
Larry Garfield has been building websites since he was a sophomore in high school, which is longer ago than he'd like to admit. Larry was an active Drupal contributor and consultant for over a decade, and led the Drupal 8 Web Services initiative that helped transform Drupal into a modern PHP platform.
Larry is Director of Developer Experience at Platform.sh, a leading continuous deployment cloud hosting company. He is also a member of the PHP-FIG Core Committee.
Larry holds a Master’s degree in Computer Science from DePaul University. He blogs at both https://platform.sh/ and https://www.garfieldtech.com/.