r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

Show parent comments

2

u/wmil Dec 02 '15

http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

Basically the big problem is that it isn't consistent. Some of the API comes from C some from Perl. Each has different semantics.

Also prior to 5.4 error messages about missing or unexpected double colon operators threw a message about T_PAAMAYIM_NEKUDOTAYIM with no explanation of what that was. It's double colon in Hebrew, for anyone wondering.

There are a lot of little things that mostly work the same as other languages, but with subtle breaking differences.

Then there are issues with how it does variable variables that can lead newbies into terrible spaghetti messes.

In comparison learning something like Python is a joy. Within a couple of days of your first line of Python you'll be typing out large programs without a single syntax error.

13

u/SaltTM Dec 02 '15

here we go again lol stop posting this dated ass article

5

u/[deleted] Dec 03 '15 edited Dec 03 '15

80% of the article is still true. The biggest:

  • It's almost 2016 and PHP still doesn't have a module system, Python had one in '91, Perl had one in '94, Ruby had one in '95

  • inequality operators still have no === equivalent

  • sorting is still indeterministic when you have null values because NULL < -1, and NULL == 0

  • arrays are the only containers in the language and they simultaneously act as sets, lists, and associative arrays which fucks up almost all array functions because you don't know what they will do

  • PHP has had exceptions for almost 10 years now and a lot of functions still require you to use their specific error function to tell if it failed

1

u/SaltTM Dec 03 '15

https://wiki.php.net/rfc/engine_exceptions_for_php7

Built in? No, but we use http://getcomposer.org now.

PHP has had exceptions for almost 10 years now and a lot of functions still require you to use their specific error function to tell if it failed

Not sure what you mean by this also PHP 7 introduced Engine Exceptions

arrays are the only containers in the language and they simultaneously act as sets, lists, and associative arrays which fucks up almost array functions because you don't know what they will do

true

inequality operators still have no === equivalent

I'm not sure what you mean by this, unless you're talking about !== ?

→ More replies (1)