Live data from Hacker News

PHP 8.5

stitcher.io

171–180 of 197 posts

Re: PHP 8.5

#171

PHP should REALLY focus on getting the core stuff in shape. Its still so annoying that you have to use mb_real_uppercase($name) for unicode. The other gripe is that the stdlib is SO messy. With PHP 5.3 they had a once in a lifetime opportunity to cleanup the stdlib and introduce a new namespaced API for builtins, and optionally introduce a uniform function call syntax: "foo"->strtoupper(); Whenever doing PHP the time…

> i dont see it being a pick for greenfield projects in 2025 You don't see it because you're not looking. There are many Laravel jobs in my area. If you think that is only for Legacy projects, might be mistaken.

Just looked at Laravel, and it feels like its trying its hardest to lipstick the PHP warts. When i look at a framework like it i see just bloat. You really only need like 5-10% of stuff thats there. Thats why its most likely slow and heavy, and looks like it was cowboy copied from some legacy .NET enterprisey framework from the early 2010s.

Jobs? Sure. There are PHP jobs, and the PHP devs are a dime a dozen. But i will agree with you, Laravel is a fine pick for websites, but not so much for more real world, high load applications.

Theres also 100x more jobs for WordPress than Laravel, so if you want to do PHP, i suggest going the WordPress route instead.

Re: PHP 8.5

#172

Earlier quoted context omitted.

> i dont see it being a pick for greenfield projects in 2025 You don't see it because you're not looking. There are many Laravel jobs in my area. If you think that is only for Legacy projects, might be mistaken.

Just looked at Laravel, and it feels like its trying its hardest to lipstick the PHP warts. When i look at a framework like it i see just bloat. You really only need like 5-10% of stuff thats there. Thats why its most likely slow and heavy, and looks like it was cowboy copied from some legacy .NET enterprisey framework from the early 2010s. Jobs? Sure. There are PHP jobs, and the PHP devs are a dime a dozen. But i wi…

That’s a strange thing to say. If I wasn’t self employed, I’d pick the job that pays more (Laravel) instead of the job that (according to you) is 100x more available.

And who really cares about bloat anyway? Hardware is super cheap nowadays. People are expensive. So why not use a framework that enables you to be (in your terms) 100x more productive?

On top of that, you’re arguing about languages and frameworks you’re not even familiar with. Why does your opinion matter at all?

Re: PHP 8.5

#173

PHP's evolution since PHP 5 has been substantial, and I think this is a real problem. As someone who learned the language years ago, the pace of change (generics, attributes, match expressions, typed properties) makes modern codebases genuinely difficult to follow. I suspect this affects many developers who cut their teeth on PHP but haven't kept up. The language has become a different beast, which is a strength for…

I used laracasts.com plus AI code assistants to bring myself back up to speed pretty quickly.

Wasn't AI meant to disenfranchise? https://news.ycombinator.com/item?id=45994928

Re: PHP 8.5

#174

Earlier quoted context omitted.

> And would be a massive headache to implement Exactly. The type system was never built for anything even slightly more complex. Its basically annotations for primitive types and classes. PHP has always had an weak type system, so adding generics will most likely never happen. > Adding generics to PHP would make CS fundamentalists somewhat happy PHP has really only one collection datatype (the infamous array), so hav…

PHP typing is most definitely stronger than python overall. Yes array is the evil collection type of everything, but that's how it's meant to work. Array is the quick and dirty 'throw everything in there' thing. PHP has classes and they're very full featured and offer lots of type safety - use those.

> PHP typing is most definitely stronger than python overall.

LOL, no its not. PHP has an weak type system, while python is strong. Both are dynamic.

    $sum = 10 + "50"; // 60 in PHP
    sum = 10 + "50"   // TypeError in python

Re: PHP 8.5

#175

Earlier quoted context omitted.

PHP is a perfect example of how to undergo major transitions correctly. In the time that it took Python to go from Python 2 to 3, PHP underwent 5.2 -> 5.3 and 5.6 -> 7.0. 5.3 changed how you write PHP in a fundamental way by introducing namespaces and PSR0 autoloading. Then, 5.6 -> 7.0 cleaned up the parser, resulting in massive speed improvements. They did this by not breaking the universe in these major updates...o…

> They did this by not breaking the universe in these major updates I don't think the amount of breakage per se was the problem with Python 3. I think the problem was that for a long time (until u"" strings in 3.3? four years after 3.0?) there was ~no way for a library to support both 2 and 3 in a single codebase. That meant that each project had to either maintain a fork, or do a "flag day" migration, which in pract…

> I don't think the amount of breakage per se was the problem with Python 3.

The lack of u"" is just another manifestation of the complete breakage they wrought upon Python's string handling, isn't it?

It was closer to a decade (3.7) till they'd put enough of the bits they'd ripped out back in for Py3 to be suitable for the things I used Py2 for.

Re: PHP 8.5

#176

Is PHP still unhelpful when it comes to writing secure code? I remember when escaping SQL input data was "the correct way" to use your mysql database. Parametrization? Nah, just use mysql_escape_string or whatever it was called.

the MySQL extension was dropped in PHP 7.0.

Re: PHP 8.5

#177
post #145

Earlier quoted context omitted.

I remember the discussions at the time about which filename extension to use - and I can not believe that .php3 won. I think that I was the first to bring up the subject for PHP 4, to use .php again and not include the version number.

i still have phtml and php3 files somewhere in backups. used to run on php one of biggish local sites that you probably know

Starts with the letter R? PHP of that era, completely procedural with concatenated SQL, such fond memories.

Re: PHP 8.5

#178

Earlier quoted context omitted.

Python managed to do this by not actually checking the types at runtime. If you declare a list[int] return type but you return a list[string] then nothing happens, you're expected to prevent that by running an offline typechecker. PHP chose to check types at runtime. To check that a value is really an array the runtime could have to loop through the entire array. All the types PHP currently implements are simple and…

Precisely. PHP has tools for this too, but lack the syntax. Right now you need to to all typings in comments, and thats just as bad as jsdoc was in 2005. This could be the way PHP could go, they just need the lexer to handle types, and not do any runtime checking at all. But i guess that goes against what the php devs want, but it sounds so wasteful, to typecheck the same code time after time even if it passed some s…

> Right now you need to to all typings in comments

What do you mean by this? The types of variables in PHP >8 are not in comments. Or did I misunderstand something?

Re: PHP 8.5

#179

Earlier quoted context omitted.

Just looked at Laravel, and it feels like its trying its hardest to lipstick the PHP warts. When i look at a framework like it i see just bloat. You really only need like 5-10% of stuff thats there. Thats why its most likely slow and heavy, and looks like it was cowboy copied from some legacy .NET enterprisey framework from the early 2010s. Jobs? Sure. There are PHP jobs, and the PHP devs are a dime a dozen. But i wi…

That’s a strange thing to say. If I wasn’t self employed, I’d pick the job that pays more (Laravel) instead of the job that (according to you) is 100x more available. And who really cares about bloat anyway? Hardware is super cheap nowadays. People are expensive. So why not use a framework that enables you to be (in your terms) 100x more productive? On top of that, you’re arguing about languages and frameworks you’re…

> And who really cares about bloat anyway? Hardware is super cheap nowadays.

That told me all i need to know. When you work on missing critical software bloat is usually THE killer in disguise. And its really hard to get rid of after a certain point.

> So why not use a framework that enables you to be (in your terms) 100x more productive?

Because i can be just as productive, and even more so by vetting, and choosing my dependencies with some hindsight. I dont cowboy pick some hype of the day thing, i take a real close look at the code and want to actually understand whats happening.

> On top of that, you’re arguing about languages and frameworks you’re not even familiar with.

I am indeed familiar with the PHP ecosystem, been there and done that.

Re: PHP 8.5

#180

I think php should have stopped at php4 or php5 and maybe just develop a new/sane standard library. And a new language could have been developed , call it hack or whatever Facebook tried. Anyway I remember php coding gave me headaches. Tried it again 2 years ago and found out the same kind of issues(outdated /inexistent documentation, different ways to do the same thing that actually didn’t work and stuff like that).…

Without specifics it's hard to understand what kind of difficulties you had.

But PHP is still so strong because it offers much more than "easy hosting".

What I personaly love most is the instant save file->see results feedback loop. There's no perceptible compilation step. Meanwhile my Java project takes a minute to compile.

Also the shared-nothing model by default is powerful and rare.

Laravel is probably the most well documented frameworks even comparing frameworks from other languages. And symfony, also a PHP framework, is not far from that.

When you say "SSL" I can only think your reasoning is based on outdated information since no one calls it SSL anymore. It's TLS for some years now. And I have been connecting to databases using PHP TLS/SSL since version 5. For almost a decade now.

Post reply on HN