Live data from Hacker News

PHP 8.0.0 beta 2

php.net

41–50 of 102 posts

Re: PHP 8.0.0 beta 2

#41
post #24
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…

I don't know how can you blame the hacking of your website on the language rather than your admin skills, there infinite number of websites built in PHP and never got hacked!

I wasn't hosting the blog. It was on webfaction.

> infinite number of websites built in PHP and never got hacked!

If I look at the logs of my webservers and scan for bots trying to exploit some vulnerability, I would guess that 80%+ of the URLs would indicate a PHP-based webapp. So, yeah, there are many that never got hacked but there are certainly a good amount of PHP apps that have some vulnerability. Should we blame all the developers who were "doing it wrong" or should we at least make sure that the language is not facilitating such shots-in-their-feet?

Re: PHP 8.0.0 beta 2

#42
I heard about PHP is really just used by wordpress and drupal to keep its popularity ranking these days, and new projects seldom adopt it based on google trends, is this true?

The new PHP7/8 is certainly exciting, is it too late?

Re: PHP 8.0.0 beta 2

#43
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…

By the way you phrase that question, you're dismissing that single key feature that PHP _already has_ that cannot be had at other established languages.

I know of no other language that lets you deploy a web app by dragging some files from the left to the right in FileZilla. No setup, No vendor lock in, no nothing. It just works.

Cross-cloud serverless frameworks that wrap AWS lambda + competitors get you somewhat close in other languages, but you still have a lot more setup to go through, and lot fewer hosting providers to choose from.

PHP's deployment and execution models really set it apart.

Re: PHP 8.0.0 beta 2

#44
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…

My favorite thing about PHP is the documentation! The comments often have exactly the example I need to do whatever simple thing I'm trying to accomplish.

Re: PHP 8.0.0 beta 2

#45
post #24

Earlier quoted context omitted.

I don't know how can you blame the hacking of your website on the language rather than your admin skills, there infinite number of websites built in PHP and never got hacked!

I wasn't hosting the blog. It was on webfaction. > infinite number of websites built in PHP and never got hacked! If I look at the logs of my webservers and scan for bots trying to exploit some vulnerability, I would guess that 80%+ of the URLs would indicate a PHP-based webapp. So, yeah, there are many that never got hacked but there are certainly a good amount of PHP apps that have some vulnerability. Should we bla…

You see lots of PHP because there is lots of PHP. The hits are because of wide adoption not language vulnerability.

Re: PHP 8.0.0 beta 2

#46
post #21

Earlier quoted context omitted.

> 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.…

> 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".

I don't think there are many people in PHP's orbit who want it to be a better Python, or a better Perl/Ruby/JavaScript.

PHP was written to be a good language for average web development, and I think that's where it will always shine. I'm perfectly happy with a gradual process of making it less crappy.

Having said that, I'd love some of Hack's features (e.g. reified generics, proper list/dict primitives) to make it into PHP.

Re: PHP 8.0.0 beta 2

#47
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 think for the vast majority of projects, this is not a question you'll be asking yourself when picking the language.

I think PHP is one of the best languages to pick when you want a quick MVP for an online service (one that doesn't require specific things PHP is not good at). The community is one of the largest, there are more developers than nearly any other backend language and Laravel is probably the most complete all-in-one backend framework out there.

So the question is often, is PHP good enough to develop a maintainable app with decent performance, where developers won't hate every minute spent on it. And the answer is pretty much yes with PHP 7+

Re: PHP 8.0.0 beta 2

#48
post #40
post #13

Earlier quoted context omitted.

> 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.

I'd like to know more about that 79% number. I would guess it's actually the case that PHP backends identify themselves as PHP far more than backends in other language x identify themselves.

Re: PHP 8.0.0 beta 2

#49
post #33

Earlier quoted context omitted.

> 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.

True, but I doubt I want to use that on a simple string function. I'd actually much prefer to see the introduction of methods on strings ala Ruby and most other natively-OOP languages rather than calling the C-style functions with the strings as a parameter, but hey, it is what it is.

Re: PHP 8.0.0 beta 2

#50
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…

By the way you phrase that question, you're dismissing that single key feature that PHP _already has_ that cannot be had at other established languages. I know of no other language that lets you deploy a web app by dragging some files from the left to the right in FileZilla. No setup, No vendor lock in, no nothing. It just works. Cross-cloud serverless frameworks that wrap AWS lambda + competitors get you somewhat cl…

Right, but isn't precisely this "drag from left to right and get a website running" that leads to an endless stream of sites that get hacked because the developer was careless/ignorant enough to leave admin.php with executable permissions?
Post reply on HN