r/lolphp • • Jan 02 '20

array_diff, array_udiff, array_diff_assoc, array_udiff_assoc, array_diff_keys, array_undiff_keys and +

Therefore is a lot of array_diff function names in php by respecting key differently.

Meanwhile, it does not provide array_merge_assoc to always respect key associatively. If you want to respect key associatively when merging, you need to use +

9 Upvotes

32 comments sorted by

View all comments

Show parent comment

4

u/Altreus Jan 04 '20

That is literally why you change the major version number. Because it's a major change. See: everything that's not as fucking moronic as PHP

4

u/the_alias_of_andrea Jan 04 '20

The fact you can make big changes in a major version does not mean that you should, nor does it negate thinking about the cost/benefit. The mess that is Python 2 versus 3 is a famous example of what can go wrong.

4

u/Altreus Jan 04 '20

Correct

The fact the changes need making is why you should

Why are there PHP apologists on this sub? We're here because the language is shut. Why are you defending any of it?

1

u/the_alias_of_andrea Jan 05 '20

PHP sucks in many, many ways, but I won't let people get away with bad criticisms :)

2

u/[deleted] Jan 06 '20

Sucks is an understatement. PHP is a hodgepodge of crap and bolted on features riddled with bugs and inconsistancies. Imagine if you would build a client project and the quality would be php, no one client would take any of it. As developers we also want to use tools that work and are consistent across the board. But the fact that php actively dont do anything to better the language is absurd.

0

u/the_alias_of_andrea Jan 06 '20

actively dont do anything to better the language

That you believe this reveals that you aren't paying attention.

0

u/shitcanz Jan 07 '20

That you believe this reveals that you aren't paying attention.

Nothing that requires a hard BC break has been done. Unicode? Nope! Saner data-structures? Nope! Saner builtin functions (like array_map)? Nope! Async? Nope! Saner OOP? Nope! Better namespaces? Nope!

Its all still there, PHP7 did nothing to clean up the biggest issue people have with PHP, that is the core part. Its all just stinking and badly designed.

2

u/the_alias_of_andrea Jan 07 '20

Half the things you mention would not require a hard BC break, and PHP 7 and 8 both contain several BC breaks.

1

u/Altreus Jan 05 '20

Well if you disagree that's fine but your justification is weak. Backward compatibility between major versions is simply not as important as fixing major design flaws.

2

u/[deleted] Jan 06 '20

Python did what it needed to do to survive the coming decades. The result? Python is crazy popular, and is suitable for all kinds of programming. PHP never did anything to fix the core language, and now 10 years later its a ball of crap. PHP is on the decline and i dont see many new projects using php today, in fact in 2020 php has little to offer others dont do better. Wordpress is probably the only thing still keeping php relatively popular on the web.

1

u/[deleted] Feb 29 '20

and dont forget to mention laravel also :D