Live data from Hacker News

PHP 8.0.0 beta 2

php.net

31–40 of 102 posts

Re: PHP 8.0.0 beta 2

#31
post #7
post #3

PHP, since version 7.0, has been a much improved language since when many people started hating on it. They have been consistently moving the spec forward and making improvements. It's not perfect, but no language really is after all. It is really nice just seeing issues that have been around for a long time being addressed and fixed.

I have to confess that I have a lot of prejudice against PHP after having to work with it at the time of PHP3 and 4. It seemed like even worse than Perl in the sense of how many things were just bolted on it as a way that the developers could claim "yeah, you can do that with PHP". After having a blog running wordpress hacked twice by mere virtue of being online, I dismissed it for good. I keep hearing about how the…

> Is there anything that PHP is developing or adopting that can not be had at other established languages?

Modern cryptography is baked in since 7.2.

https://libsodium.gitbook.io/doc/bindings_for_other_language...

Most of the people who shit on PHP have a lot of love for other languages. A survey of the cryptography features the "favored" languages offer will almost certainly fall into two camps:

1. "We wrap OpenSSL"

2. "Go compile it yourself" (i.e. there is nothing baked in)

There's a lot of badness with OpenSSL's API design, especially with asymmetric cryptography. For a fun exercise in these languages, try encrypting with RSA with OAEP padding, but without using SHA1 as your hash function.

For completeness, PHP is one of the languages that wraps OpenSSL too! But it also wraps libsodium, and the community has been moving towards libsodium (unless they need something from OpenSSL for the sake of backwards compatibility) since early in the 7.x series.

If you're going to provide cryptography features in your language, but you aren't shipping modern cryptography in your standard library, you're underperforming what PHP has offered for years at this point. The easiest way to meet the standard that PHP 7.2+ establishes is to add libsodium to your language's standard library.

(There are salient arguments for "why even provide a cryptography feature as part of the language at all?" but most of the languages that see real world deployment are already doing that.)

Re: PHP 8.0.0 beta 2

#32
post #7
post #3

PHP, since version 7.0, has been a much improved language since when many people started hating on it. They have been consistently moving the spec forward and making improvements. It's not perfect, but no language really is after all. It is really nice just seeing issues that have been around for a long time being addressed and fixed.

I have to confess that I have a lot of prejudice against PHP after having to work with it at the time of PHP3 and 4. It seemed like even worse than Perl in the sense of how many things were just bolted on it as a way that the developers could claim "yeah, you can do that with PHP". After having a blog running wordpress hacked twice by mere virtue of being online, I dismissed it for good. I keep hearing about how the…

As a gross oversimplification, I would say that the vast majority of languages share the same core functionality, then there's a little sliver that sets them apart from others and makes them unique. I would probably say that what sets PHP apart is it's easy. It's easy to install, use, develop with it, deploy, find hosts that support it, and get help from the community.

It's a decent language and with frameworks like Laravel you can quickly build reliable CRUD apps, which is the vast majority of websites and development.

Re: PHP 8.0.0 beta 2

#33
post #17

Earlier quoted context omitted.

> Is there anything that PHP is developing or adopting that can not be had at other established languages? IMO, no. The language is still near the bottom for both dynamic and "static" typed languages. HOWEVER, if you're doing web backend stuff, Laravel and Symfony are both really solid frameworks. The direction PHP Is moving in right now is to emulate Java 7, but without generics or concurrency. It's definitely a dea…

> IMO, no. The language is still near the bottom for both dynamic and "static" typed languages. Why do you say that? It's faster than Python and Ruby for most cases, still extremely simple to deploy, the package manager (Composer) is very predictable and easy to deal with compared to Pip or Rubygems, the documentation is good, etc. It has clean lambda functions that you can pass around easily and has for more than a…

Parameter order was somewhat resolved with the introduction of named parameters in the upcoming php 8 release from this year.

Re: PHP 8.0.0 beta 2

#34
post #7
post #3

PHP, since version 7.0, has been a much improved language since when many people started hating on it. They have been consistently moving the spec forward and making improvements. It's not perfect, but no language really is after all. It is really nice just seeing issues that have been around for a long time being addressed and fixed.

I have to confess that I have a lot of prejudice against PHP after having to work with it at the time of PHP3 and 4. It seemed like even worse than Perl in the sense of how many things were just bolted on it as a way that the developers could claim "yeah, you can do that with PHP". After having a blog running wordpress hacked twice by mere virtue of being online, I dismissed it for good. I keep hearing about how the…

> Is there anything that PHP is developing or adopting that can not be had at other established languages?

I would say no, but of course, the same is true of most other established languages. What's interesting about PHP is that it's shifting from being a dumpster fire that you would never pick over a real language like Python/Ruby/node/Java/whatever, to one that's honestly broadly comparable for many tasks.

Is it innovating or doing anything really unique? Well, no, but you don't tend to find much innovation or unique features in any of those languages (these days, anyhow). At best they copy them (eventually) from the innovative languages. :)

> I seriously would like to know if it makes sense for a non-PHP developer to look into it

No more or less so than any other big, mainstream, relatively popular language. Learn it because you need it for a job, or because you'd like to see how another language ecosystem solves common problems. Don't learn it thinking you're going to see anything especially new.

Re: PHP 8.0.0 beta 2

#35
post #21
post #7

Earlier quoted context omitted.

I have to confess that I have a lot of prejudice against PHP after having to work with it at the time of PHP3 and 4. It seemed like even worse than Perl in the sense of how many things were just bolted on it as a way that the developers could claim "yeah, you can do that with PHP". After having a blog running wordpress hacked twice by mere virtue of being online, I dismissed it for good. I keep hearing about how the…

> Is there anything that PHP is developing or adopting that can not be had at other established languages? No, not really, but it's still very good for casual web development, which makes up the lion's share of all backend code being written today. Languages don't need to evolve a ton to be popular – just look at Python, which is doing very well despite not having had a ton of radical changes.

It's not "just" the language. It's also a matter of what the improvements bring in for possibilities of new developers and mindshare.

Python as a language hasn't changed much, but it made huge strides into the scientific community and got a lot of marketshare from ecosystems like R and Matlab. It's becoming king in the ML/AI side. Go is growing in the backend systems/devops stuff that used to be the realm of Python. Rust is getting more and more adoption as a systems language and focus on safety. Even Java seems to be adopting things that make it less bureaucratic while being general enough for the enterprise.

I am not saying that PHP has to go away or anything. It's just that I wished that new releases could have more interesting things to say besides "it's not as crappy as it used to be".

Re: PHP 8.0.0 beta 2

#36
post #12
post #4

Earlier quoted context omitted.

Maybe I'm not in the right circles but I see absolutely no renewed interest towards PHP. Is there any reason to believe that? Honest question - PHP was my first language (or second if you want to consider mIRC scripting) and I have not so bad memories but at least me and everybody I know moved away from it years ago and don't see people going back to it anytime soon.

There's been one big change in the last 5 years – the adoption of type-inferring PHP static analysis tools in CI. As companies started adopting TypeScript/Flow into their Javascript pipeline, PHP developers realised the need for something similar in their ecosystem. I work at Vimeo (which has a lot of business logic in PHP) and I took it upon myself to write a static analysis tool (which you can play with at https://…

Thats pretty rad.

I'm curious if you guys use PHP at all for any real time workloads. Thats where I've always had struggles with PHP.

Also, have you found the event dispatch system of the modern PHP frameworks to be slower over time?

Re: PHP 8.0.0 beta 2

#37
post #14
post #4

Earlier quoted context omitted.

Maybe I'm not in the right circles but I see absolutely no renewed interest towards PHP. Is there any reason to believe that? Honest question - PHP was my first language (or second if you want to consider mIRC scripting) and I have not so bad memories but at least me and everybody I know moved away from it years ago and don't see people going back to it anytime soon.

Symfony was the backend framework with the most contributors in 2019[1], and Laravel is seeing some huge growth in the PHP community. I think there's a lot of hype for the modern improvements in the language, and it's quite easy to manage a stateless web server in production making it a safe technology to use. [1]: https://symfony.com/blog/symfony-was-the-backend-framework-w...

Doesn't make it the best backend framework of 2019!

In all seriousness, I think this has more to do with the ease of PHP development comparatively to other stacks. Even Python (arguably just as easy to learn as PHP), has more overhead here.

Re: PHP 8.0.0 beta 2

#38
post #4

PHP is seeing a renascence and renewed interest similar to what happened with JavaScript a few decades ago. A language that's easy to make fun of but widely used is an attractive target for improvement.

Maybe I'm not in the right circles but I see absolutely no renewed interest towards PHP. Is there any reason to believe that? Honest question - PHP was my first language (or second if you want to consider mIRC scripting) and I have not so bad memories but at least me and everybody I know moved away from it years ago and don't see people going back to it anytime soon.

I mean surely that depends on the crowed you hang around with. Majority of people I interact with use PHP primarily. Anecdotal evidence isn't great at identifying trends.

Re: PHP 8.0.0 beta 2

#39
post #12
post #4

Earlier quoted context omitted.

Maybe I'm not in the right circles but I see absolutely no renewed interest towards PHP. Is there any reason to believe that? Honest question - PHP was my first language (or second if you want to consider mIRC scripting) and I have not so bad memories but at least me and everybody I know moved away from it years ago and don't see people going back to it anytime soon.

There's been one big change in the last 5 years – the adoption of type-inferring PHP static analysis tools in CI. As companies started adopting TypeScript/Flow into their Javascript pipeline, PHP developers realised the need for something similar in their ecosystem. I work at Vimeo (which has a lot of business logic in PHP) and I took it upon myself to write a static analysis tool (which you can play with at https://…

Your example is similar to a WordPress developer saying they adopted modern PHP - sure, they were on PHP already. But at least Vimeo still wanted to stick to PHP so that's one positive point.

Re: PHP 8.0.0 beta 2

#40
post #13
post #7

Earlier quoted context omitted.

I have to confess that I have a lot of prejudice against PHP after having to work with it at the time of PHP3 and 4. It seemed like even worse than Perl in the sense of how many things were just bolted on it as a way that the developers could claim "yeah, you can do that with PHP". After having a blog running wordpress hacked twice by mere virtue of being online, I dismissed it for good. I keep hearing about how the…

> after having to work with it at the time of PHP3 and 4 PHP 5 was released 16 years ago and was a massive evolution of the language. The same is true for PHP 5.2, 5.3, and 7. It's safe to say that your conclusions about the language are no longer accurate. > Is there anything that PHP is developing or adopting that can not be had at other established languages? No. I can't think of any reason to start a new project…

WordPress accounts for approximately 60% of all websites, PHP accounts for approximately 79% (knows server side sites). So I would say it is particularity popular.
Post reply on HN