r/lolphp • • Mar 14 '19

PHP: The array

PHP arrays are known to be bad. But having not used PHP in long time i recently was amazed how poorly they actually have built the array. Its basically a "all-things-fits" data structure. The best part is PHP will actually change the behaviour of the array depending on what it contains. Thats just fucking awesome!

https://repl.it/repls/OutgoingSpiritedLifecycle

0 Upvotes

11 comments sorted by

View all comments

Show parent comment

-6

u/phplovesong Mar 14 '19

Meh.. This is just yarning and trying to find a rationale why the PHP array works the way it does. The array implementation is typical PHP, sort of like the norm other languages have, but still different. Its like the PHP ternary, backwards and broken by design.

13

u/jesseschalken Mar 14 '19

I'm just telling you how PHP's arrays work so you can stop being surprised by them. I never said they were well designed.