PHP Tek 2024 PHP Tek 2024 Login
Never* use arrays
Speaker: Larry Garfield
Never* use arrays

Level: Intermediate (some prior knowledge necessary)
Length: Standard (50 minutes)

Description:
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.

JoindIn: https://joind.in/event/phptek-2024/never-use-arrays

View Slides: https://presentations.garfieldtech.com/slides-never-use-arrays/phptek2024/

Thanks to our PHP Tek 2026 sponsors!
PHP Architect
(Platinum)
PHPScore
(Gold)
Displace
(Gold)
Previous Sponsors
PHP Architect
PHP Architect
PHP Tek 2025, PHP Tek 2024, PHP Tek 2023
Prompt
Prompt
PHP Tek 2025
WPConcierge
WPConcierge
PHP Tek 2025
Roave
Roave
PHP Tek 2025
typesense
typesense
PHP Tek 2025
Geocod.io
Geocod.io
PHP Tek 2025
Vehikl
Vehikl
PHP Tek 2025, PHP Tek 2024
Laravel
Laravel
PHP Tek 2025
OSMI
OSMI
PHP Tek 2025, PHP Tek 2024, PHP Tek 2023
Clayton Kendall LLC
Clayton Kendall LLC
PHP Tek 2025
NativePHP
NativePHP
PHP Tek 2025
Compassionate Coding
Compassionate Coding
PHP Tek 2024
Private Packagist
Private Packagist
PHP Tek 2024
Zend
Zend
PHP Tek 2024
SensioLabs
SensioLabs
PHP Tek 2024
Vonage
Vonage
PHP Tek 2024
PubNub
PubNub
PHP Tek 2024
FusionAuth
FusionAuth
PHP Tek 2024
DevITjobs
DevITjobs
PHP Tek 2024
PhpStorm
PhpStorm
PHP Tek 2023
Infobip
Infobip
PHP Tek 2023
PhoneBurner
PhoneBurner
PHP Tek 2023
platform.sh
platform.sh
PHP Tek 2023