Live data from Hacker News

PHP 7.2.0 Released

php.net

61–70 of 80 posts

Re: PHP 7.2.0 Released

#61
post #44

Earlier quoted context omitted.

Agreed. We use PHP for automation scripts (this decision was made a long time ago). In terms of features it's a good language but it's not fun to work with.

I think the mix of static typehinting and dynamic language is actually kind of well balanced now in version 7, but maybe that's just me leaving ruby's magic behind after many years and happy about IDE support and static checks ;)

I don't know what is about PHP. Objectively it's a nice language and the direction it has taken with version 7 looks very good. But somehow I don't enjoy it. C#, C++ or Rust motivate me to explore new approaches and are stimulating but I don't get that vibe from PHP. It just feels like tedious work.

Re: PHP 7.2.0 Released

#62
post #47
post #16

Earlier quoted context omitted.

Four words : composer, symfony, laravel and php-fig. The php ecosystem is not what it was 4 years ago. Although due to backward compatibility the languages still has a lot of cruft. But this means old code often works directly with the last version and benefits from its performance improvement. If your new project is about receiving an http request and send a response like a REST API I think it is a good tool for the…

I don't get the love for Laravel. Things like validation, specifying validators in strings like it's 2003 grate with me. Symfony's a pain in the butt for over-engineering things (DataTransformers are a good place to start) but at least it's well thought through. What are the reasons to love Laravel?

I found Validation a pain to use in Laravel as well which is why I don't use that feature.

Everything else: MVC, Migrations, Blade, Auth, Email Handling, Artisan commands are why I keep using Laravel.

Re: PHP 7.2.0 Released

#63
post #61

Earlier quoted context omitted.

I think the mix of static typehinting and dynamic language is actually kind of well balanced now in version 7, but maybe that's just me leaving ruby's magic behind after many years and happy about IDE support and static checks ;)

I don't know what is about PHP. Objectively it's a nice language and the direction it has taken with version 7 looks very good. But somehow I don't enjoy it. C#, C++ or Rust motivate me to explore new approaches and are stimulating but I don't get that vibe from PHP. It just feels like tedious work.

Yeah I can absolutely relate to that. Not sure about C# being more motivating (from some limited experiments I made), but php is definitely not an inspiring language. Or it leads your inspiration elsewhere, like generating code and only using php as a target language, etc. But over time having a language with a limited feature set is kind of a plus too, just because you can't get too crazy either, and it's easier to read other people's code and introduce new team members.

Re: PHP 7.2.0 Released

#64
post #49

One of the biggest improvements is that Libsodium is now built-in. https://dev.to/paragonie/php-72-the-first-programming-langua... No more Mcrypt, less cases of having to use OpenSSL and using it wrong. This is a huge security step towards the future.

The other thing is that they have partially fixed the most "wat" bug in PHP: for some arrays that aren't even all that hard to come by when interacting with JS, the following code could change `count($arr)`: foreach ($arr as $key => $val) { $arr[$key] = f($key, $val); } The issue is that `$key` could be a string describing an integer, but `$arr[$key]` will automatically see that you're using a string-int and convert…

I would typically write:

   foreach ($arr as $key => &$val)
        $val = f($key, $val);
This would avoid this issue, while bing simpler.

Re: PHP 7.2.0 Released

#65
post #47
post #16

Earlier quoted context omitted.

Four words : composer, symfony, laravel and php-fig. The php ecosystem is not what it was 4 years ago. Although due to backward compatibility the languages still has a lot of cruft. But this means old code often works directly with the last version and benefits from its performance improvement. If your new project is about receiving an http request and send a response like a REST API I think it is a good tool for the…

I don't get the love for Laravel. Things like validation, specifying validators in strings like it's 2003 grate with me. Symfony's a pain in the butt for over-engineering things (DataTransformers are a good place to start) but at least it's well thought through. What are the reasons to love Laravel?

> What are the reasons to love Laravel?

Like you seem to have learned already, the reason to love Laravel is that it's not Symfony.

Re: PHP 7.2.0 Released

#66
post #53
post #21

Earlier quoted context omitted.

I don't know whether the alternatives are objectively better, except maybe in certain domains. Mostly, people seem not to like PHP because they find it ugly and awkward... which is valid, but subjective. The major alternatives (JS, Ruby and Python) have documentation, frameworks and reasonably comprehensible paths to an MVP, although one could argue that PHP is still slightly better in terms of speed of deployment. E…

> PHP is still slightly better in terms of speed of deployment When it comes to securing the deployment I think Python/Ruby would be better though - if you factor that in I would say it would be faster for me to deploy a python app than configure php to be secure.

How do you justify that claim? I'm pretty sure it's the other way around.

Re: PHP 7.2.0 Released

#67
post #57
post #8

Earlier quoted context omitted.

Yes, strange for a bug fix to be top of a list of features, however... I don't agree that it's "not the most eventful" release:- libsodium being included into the core is a big tick in the box in terms of maturing as a language; modern - secure - cryptography out of the box.

I'm surprised PHP hasn't had this for a while. Isn't PHP nearly 20 years old? Is it common for web languages to grow so old before they get crypto in the standard library?

You are right, of course, but nonetheless this is a significant step forward for the language (and the ecosystem as a whole).

I do hope that - just like yourself, I am sure - the next significant step is more organically and proactively developed, and not treated (at least in the wider communtity's eyes) as a belated addition to a bewildered leviathan.

Re: PHP 7.2.0 Released

#68
post #57
post #8

Earlier quoted context omitted.

Yes, strange for a bug fix to be top of a list of features, however... I don't agree that it's "not the most eventful" release:- libsodium being included into the core is a big tick in the box in terms of maturing as a language; modern - secure - cryptography out of the box.

I'm surprised PHP hasn't had this for a while. Isn't PHP nearly 20 years old? Is it common for web languages to grow so old before they get crypto in the standard library?

> PHP 7.2: The First Programming Language to Add Modern Cryptography to its Standard Library

https://dev.to/paragonie/php-72-the-first-programming-langua...

Re: PHP 7.2.0 Released

#69
post #2

Literally only object as new typehint, not the classname of the object? This doesn't really help much. https://wiki.php.net/rfc/object-typehint Looks like they went back into perl-mode

Previously you could only specify class names and interfaces, now you can specify object (any object of any class, including StdClass). Mostly only a way to type hint "not array or any scalars". The class names has been around a while and is usually way more useful.

Re: PHP 7.2.0 Released

#70
post #10

What is PHP like nowadays? I know it has a bad reputation and a history of kitchen sink design but have they managed to tame it into something more sensible? Do the docs help steer developers away from legacy issues and common bad patterns? Would anyone recommend it for new projects?

> Would anyone recommend it

Slack would, https://slack.engineering/taking-php-seriously-cf7a60065329

Post reply on HN