Live data from Hacker News

PHP 8: Before and After

stitcher.io

31–40 of 346 posts

Re: PHP 8: Before and After

#32

Earlier quoted context omitted.

I have worked with PHP for years, and I agree completely. I think the people who defend PHP either have too much invested in it, or they have never gotten productive in a saner language. Or both.

The people who invested "too much" in it don't have to defend it. They'll simply continue using it. They'll enjoy the new functionality. If I make millions upon millions of revenue with a PHP application, I don't care if tech nerds dislike the syntax used to build it.

Syntax is very far down the list of problems with PHP

Re: PHP 8: Before and After

#33

Seriously, enough with PHP. Can we just let it die? I worked with PHP 5.6 years ago and I hated it. Recently I worked with PHP 7. Heard about all the work that's been done on it and I was kinda excited to try it. It's still so broken. It doesn't matter if they improve performance or add new cool features. PHP is broken in ways that can't be fixed without breaking compatibility. Fork it or put it out of its pain.

Yeah, as another user has said, PHP is getting "cooler" (do you get it?). However not only because it is turning into a sort of "Java-like" is will be get heater again. PHP is fine for its stuff on FastCGI but more further than that, I don't think so, sorry. There are many of programming language alternatives out there.

Re: PHP 8: Before and After

#34

Earlier quoted context omitted.

True but the php syntax is way too bad (like $ etc) in comparison to Java.

You can’t build websites with Java

> You can’t build websites with Java

The (popular) horrors that are Symfony, Laravel, Doctrine and co were all inspired by Java Web frameworks and ORM.

Re: PHP 8: Before and After

#35
post #22

Earlier quoted context omitted.

You can’t build websites with Java

Isn't Gmail built with Java and GWT? or was untill very recently?

Sure, you can build a website with anything really.

I just bored of the hating on PHP when it continues to fit the web so well and some enormous percentage of sites are built in PHP.

Re: PHP 8: Before and After

#36
post #6

It's becoming kind of an Enterprise language [1]. Don't get me wrong I think PHP is getting cooler, hopefully everybody catches up and the fact that You can have a shared hosting for pennies run Your PHP code really puts it at an advantage compared to others. [1]: https://github.com/joaomilho/Enterprise

Lately I see myself abusing (???) types more often than ever. Before, I'd feel comfortable returning an array of structured data from a function. Now, I'm creating Value Objects to ensure my data is both valid and correctly used elsewhere. Kinda feels nice to get intellisense working too and knowing that the things that I'm trying to do with that VO are valid

> Before, I'd feel comfortable returning an array of structured data from a function. Now, I'm creating Value Objects to ensure my data is both valid and correctly used elsewhere.

Same. I've written some complicated ETL/data transform processes in PHP, and used arrays because the array_* functions are so useful for manipulation.

But keeping track of what keys were available was a nightmare - especially coming back to maintain the system.

Like you I've switched to Value Objects. In many ways it's a pain (the intermediate representation that I'd stick into a new array key and pass to the next transformation - it doesn't belong on any of the objects; and PHP needs the equivalent of the array_* functions for objects) but knowing I can't use the wrong key somewhere makes it worthwhile.

Re: PHP 8: Before and After

#37
post #26

Earlier quoted context omitted.

This is such a shallow elitist comment. A lot of the common criticisms levied at PHP have been corrected years ago, and PHP is responsible for hundreds of billions of dollars of turnover globally. Of the top 10 websites in the world, PHP is partially or wholly powering more than half of them. Wikipedia, Wordpress, online retail. I have personally created 6 figures of value because I could quickly dump some PHP script…

> This is such a shallow elitist comment. A lot of the common criticisms levied at PHP have been corrected years ago, and PHP is responsible for hundreds of billions of dollars of turnover globally. So does Java, Python, C and C++. This is also a shallow argument. No language is perfect but PHP still suffer from the same design issues a 10/15 years ago, none of them have been correct and it's perfectly valid to point…

PHP is a great fit for the web, always will be. There are “better” languages and solutions but they are usually more difficult to setup or not as easy to learn.

Re: PHP 8: Before and After

#38

Earlier quoted context omitted.

The people who invested "too much" in it don't have to defend it. They'll simply continue using it. They'll enjoy the new functionality. If I make millions upon millions of revenue with a PHP application, I don't care if tech nerds dislike the syntax used to build it.

Syntax is very far down the list of problems with PHP

And even those problems are very far down the line if the business logic results in the expected revenue.

Re: PHP 8: Before and After

#40

I'm glad you can now write: public static function new(): static { return new static(); } It really brings the point across it's static.

I know you're trolling, but FYI the `static` before function has nothing to do with the `static` return type. Like other programming languages the term `static` is used to denote two things.
Post reply on HN