PHP becomes a complex language with each update. For what reason? Its application is still limited to the web, mostly.
PHP 8.5
11–20 of 197 posts
Re: PHP 8.5
#12A lot of people are too proud to be associated with PHP. I am ready to admit that know nothing about the language except that a lot of people make cool things with it. My favourite PHP product at the moment is BookStack ( https://www.bookstackapp.com/ ), a really good wiki. I run an instance for my family and it's great. But there are loads of things. And I notice that many of the sites I like using...are built on we…
PHP is a very pleasant and straight-forward language to work with. I enjoyed my time working with it, though I did also see quite a lot of very poor code. I think the danger with PHP is more its ability to easily cause *very bad things*. This would partially be poor training (my University literally taught PHP with SQL-injectable examples), and I think the language itself making it very easy, such that less-experienc…
Is there any language where you can't?
Re: PHP 8.5
#13Earlier quoted context omitted.
PHP is a very pleasant and straight-forward language to work with. I enjoyed my time working with it, though I did also see quite a lot of very poor code. I think the danger with PHP is more its ability to easily cause *very bad things*. This would partially be poor training (my University literally taught PHP with SQL-injectable examples), and I think the language itself making it very easy, such that less-experienc…
> I think the danger with PHP is more its ability to easily cause very bad things . Is there any language where you can't?
Re: PHP 8.5
#14Earlier quoted context omitted.
> I think the danger with PHP is more its ability to easily cause very bad things . Is there any language where you can't?
Probably not, but not most languages are not inviting to do them.
Or as Bjarne Stroustrup put it: There's two types of languages: The ones people complain about and the ones noone uses
Re: PHP 8.5
#15Re: PHP 8.5
#16Re: PHP 8.5
#17Earlier quoted context omitted.
PHP is a very pleasant and straight-forward language to work with. I enjoyed my time working with it, though I did also see quite a lot of very poor code. I think the danger with PHP is more its ability to easily cause *very bad things*. This would partially be poor training (my University literally taught PHP with SQL-injectable examples), and I think the language itself making it very easy, such that less-experienc…
> I think the danger with PHP is more its ability to easily cause very bad things . Is there any language where you can't?
For the longest time the language had been developed with this mentality that it's okay to continue running if something broke, that it's better to print out something than to do nothing and bail out.
Which means that for things to run reliably, you have to write very defensive code that checks everything you can think of. Which is probably a good idea with any language, but I find that old PHP requires much more of this.
Thankfully, they've been changing that over the past decade while still maintaining decent compatibility with old code. I just recently finished porting a pretty large project (~2 mil SLoC) from the ten year old 5.6 to the currently latest 8.4, and it's been pretty painless. The only things that broke were those that were never actually properly implemented and worked by pure chance.
Re: PHP 8.5
#18PHP becomes a complex language with each update. For what reason? Its application is still limited to the web, mostly.
I think these days you could change "You can write Fortran in any language" to "You can structure your code like Spring in any language"…
Re: PHP 8.5
#19PHP becomes a complex language with each update. For what reason? Its application is still limited to the web, mostly.
Still, even if it was "just" the web, why wouldn't it evolve? It's a great language, with a big user base, and there's always room for improvements and to increase the developer experience
Re: PHP 8.5
#20 $output = $input
|> trim(...)
|> (fn (string $string) => str_replace(' ', '-', $string))
|> (fn (string $string) => str_replace(['.', '/', '…'], '', $string))
|> strtolower(...);
... I think why not just something like the following? $output = $input
|> trim($)
|> str_replace(' ', '-', $)
|> str_replace(['.', '/', '…'], '', $)
|> strtolower($);