Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
elraE4319yarray (1,2) it's easier to find and identify an array when you can look and search for the word array
-
[1,2] for sure. It's not technically shorthand, just an upgrade in the syntax since let's be fair, it's not that much shorter than array(1,2) 😂
I would advice though not to mix in the same file since it can get messy and confusing for future maintainers. -
morhir1449yHad a problem with [1,2] format the other day the clients hosting provider said my code was unusable and of poor quality, actual problem was PHP version 5.2! I told them that there service is crap and out dated and that I wouldn't be changing my code, client now hosts via me :D
Related Rants
array(1, 2) or [1, 2]?
undefined
php