Live data from Hacker News

PHP 8.0.0 beta 2

php.net

21–30 of 102 posts

Re: PHP 8.0.0 beta 2

#21
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?

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.

Re: PHP 8.0.0 beta 2

#22
post #18
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? Good documentation and reasonable backwards compatibility.

You can have both at other languages and platforms.

Re: PHP 8.0.0 beta 2

#23
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?

Probably not, but that's the wrong question. The real question is: If you already know PHP, is there enough incentive/benefit to switching languages? Based on the experience of PHP devs I know (I personally haven't used it in years), the answer is "no" for many (most?) web dev cases.

Re: PHP 8.0.0 beta 2

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

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!

Re: PHP 8.0.0 beta 2

#25

If the JIT for PHP ever becomes good enough it solves the memory leak problems PHP to this day is still plagued with, that might be enough to convince me to use PHP again, possibly, for some workloads. I can't help but feel that PHPs popularity is mostly tied to Wordpress, and to a lesser extend Laravel (with Symfony coming in behind that). Not really sure the rest of the ecosystem even matters, outside those core pi…

What are the memory leak problems? I was under the impression that PHP's stateless nature, with a whole new instance of everything coming into being for each request, somewhat sidesteps the capacity for problematic memory leaks that could otherwise exist for processes that remain alive between requests.

> I was under the impression that PHP's stateless nature, with a whole new instance of everything coming into being for each request

A couple issues here.

1. Even if the PHP process exits after each request, memory leaks during the request are still an issue. If I'm looping through 1,000 elements of an array and leaking memory each time, I could end up with a peak memory usage of 100MB when 1MB would've sufficed. That forces me to scale vertically when I might not otherwise need to.

2. Most mature applications have worker processes that may be longer-lived than serving an HTTP request. If PHP leaks memory, it's less suited to those tasks. Maybe you write those in Go instead, but then you have to ask yourself why you didn't just write the whole application in Go.

Re: PHP 8.0.0 beta 2

#26
post #17
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? 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 decade. Type hinting has been in place for a long time, too, as have enough OOP / reflection constructs to do just about anything you'd reasonably want to do in a language aimed primarily for web development.

The only downside of PHP that I can still point to is that it's sometimes hard to remember the function parameter order for some of the common string and array functions. Far from a dealbreaker, that.

Re: PHP 8.0.0 beta 2

#27

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.

> PHP is seeing a renascence and renewed interest

I have seen no PHP renaissance anywhere (real life, Hacker News, reddit, or anywhere else), but I also checked TIOBE[1]. PHP's popularity peaked in 2006, when it was 500% as popular as it is now.

1. https://www.tiobe.com/tiobe-index/php/

Re: PHP 8.0.0 beta 2

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

[deleted]

Re: PHP 8.0.0 beta 2

#29
post #9

PHP is damn good in certain areas. It is one of the best choices (if not the best choice) for rapid prototyping of a program. Its damn fast to similar alternatives (Python, Ruby, Dart, JavaScript), and the standard library is huge. It does have footguns. I am not a fan of the loose typing, but you can take some steps to mitigate. You can do "===", "strict_types" and type hinting for function input and output. It is s…

I can't believe named arguments aren't default in every language. TypeScript could have implemented it.

https://github.com/Microsoft/TypeScript/issues/467#issuecomm...

Re: PHP 8.0.0 beta 2

#30
post #5

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.

The Laravel framework ( https://laravel.com ) and its growing ecosystem and welcoming community is a great example of this renaissance.

Is it? Laravel effectively has a single maintainer, as its other contributors seem to have abandoned it[1].

It also seems to have declining interest after peaking in 2017[2].

EDIT: I was looking at the wrong repository, so my comment about Laravel's popularity is wrong.

1. https://github.com/laravel/laravel/graphs/contributors

2. https://trends.google.com/trends/explore?date=today%205-y&ge...

Post reply on HN