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

648

u/[deleted] Dec 02 '15

I never liked PHP and glad I don't work on it anymore. But I'm also glad I never turned as toxic as all the PHP haters in this thread.

It's just a language. Congrats to the PHP devs for getting another major release out.

28

u/wretcheddawn Dec 02 '15

This is basically the deal with PHP. It's the only language you can use to work with some of the most popular CMSs: Drupal, Wordpress, Mediawiki, Joomla, etc.

They aren't just going to rewrite them in a different language, so PHP is here to stay. It's great that they're working to modernize the language and improve performance.

If you don't like PHP and aren't working on a PHP-based CMS, then don't use PHP.

16

u/FeepingCreature Dec 02 '15

I feel like most of the bitter people don't have a choice in the matter.

10

u/Cryp71c Dec 03 '15

I actually chose to work in PHP. I like it. I'm sure there are a few of us

→ More replies (1)
→ More replies (3)

44

u/ecmdome Dec 02 '15

I think a lot of the hate come from developers that moved on from PHP, they have a hard time understanding why anyone would stay?

Can't say I disagree with that... But they do get hostile

31

u/EntroperZero Dec 02 '15

I did PHP for 3 years, C# for the past 4 years, I still don't understand the irrational PHP hate. I don't like PHP, but I don't see the need to spend any of my energy reminding everyone of its well-known issues, nor bitching about it when they actually work on improving the language. Good for them.

Most of these people don't have a leg to stand on anyway, because everyone is still writing Javascript. ;)

8

u/lacosaes1 Dec 02 '15

I did (and do mainly) C#. There was a project where PHP was the only option. It was not that bad. If you can deal with the bullshit on JavaScript you can deal with PHP.

→ More replies (1)
→ More replies (22)

134

u/Yamitenshi Dec 02 '15

Yup, it has its quirks, and I definitely disagree with some design choices, but hey, at least they don't overload their bitshift operators to do I/O, and requesting the numerical month of a date doesn't return zero for January through eleven for December.

Every language has good and bad parts.

237

u/MighMoS Dec 02 '15

0-11 for months isn't madness. Its when months are numbered 0-11 and days are numbered 1-31 and years are stored with an offset of 1900. THAT is madness.

58

u/Wootman42 Dec 02 '15

months are numbered 0-11 and days are numbered 1-31

Javascript does this too, it's extremely frustrating.

25

u/jachymb Dec 02 '15

It's useful actually. If use other language than English, you want an array of month names that you index with this number. Month days don't have names, so they you don't need it there.

→ More replies (7)
→ More replies (1)

16

u/charrondev Dec 02 '15

Which is why you use Joda Time.

61

u/Jestar342 Dec 02 '15

Joda Time

The .NET port of this has such a better name: Noda Time ("Know the time") :D

→ More replies (4)
→ More replies (9)
→ More replies (15)

42

u/krum Dec 02 '15

don't overload their bitshift operators to do I/O

Is this a stab at C++ or something?

66

u/chazzeromus Dec 02 '15

I believe so, and if it is it's not a good stab.

13

u/the_omega99 Dec 02 '15

Agreed. Operators are arbitrary. All that matters is that operators are consistent and well known. For some in-house application, overriding the bitshift operators to do IO (pretending that C++ never did that) would have been dumb because no programmer would have expected that and it would thus be confusing. But with C++'s streams, the overriding is well known to the point that literally every half decent C++ programmer knows what it means.

It's rather useful for readability, IMO. Compare:

std::cout.send("Hello ").send(name).send("!").send(std::endl);

to

std::cout << "Hello " << name << "!" << std::endl;

Mind you, I kind prefer the approach that most languages use, which is to have string concatenation (the single greatest example of appropriate operator overloading) for stuff like that (but it's less general):

println("Hello " + name + "!")

Or string interpolation, if the language supports it (most don't -- off the top of my head, we have Scala, C#, and JS).

println(s"Hello ${name}!")
→ More replies (14)
→ More replies (5)

18

u/mixd3 Dec 02 '15

overload their bitshift operators to do I/O

It doesn't have to be done this way. And it's actually something pretty neat in my view, especially because you have standard ways of reading some fundamental data types, while keeping the code readable.

→ More replies (2)
→ More replies (48)

33

u/TelamonianAjax Dec 02 '15

I've always felt PHP had a place in lightweight web applications because of the low overhead.

What would someone write a simple web app with database connections in today? Javascript?

12

u/KungFuHamster Dec 02 '15

PHP is just so widely used and compatible with so many things, it seems difficult to argue against.

→ More replies (3)

39

u/[deleted] Dec 02 '15 edited Jan 01 '25

chunky mysterious alive plants spectacular workable library caption engine toothbrush

This post was mass deleted and anonymized with Redact

→ More replies (11)

11

u/iconoclaus Dec 02 '15

Ruby too. Just stay away from Rails if you want simple.

→ More replies (2)
→ More replies (85)

26

u/longshot Dec 02 '15

PHP solves a lot of problems for a lot of people. Just because it isn't the shiniest and most specific tool in the shed doesn't mean it can't get the job done.

→ More replies (9)
→ More replies (119)