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 ;)
PHP 7.2.0 Released
61–70 of 80 posts
Re: PHP 7.2.0 Released
#62Earlier 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?
Everything else: MVC, Migrations, Blade, Auth, Email Handling, Artisan commands are why I keep using Laravel.
Re: PHP 7.2.0 Released
#63Earlier 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.
Re: PHP 7.2.0 Released
#64One 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…
foreach ($arr as $key => &$val)
$val = f($key, $val);
This would avoid this issue, while bing simpler.Re: PHP 7.2.0 Released
#65Earlier 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?
Like you seem to have learned already, the reason to love Laravel is that it's not Symfony.
Re: PHP 7.2.0 Released
#66Earlier 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.
Re: PHP 7.2.0 Released
#67Earlier 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?
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
#68Earlier 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?
https://dev.to/paragonie/php-72-the-first-programming-langua...
Re: PHP 7.2.0 Released
#69Literally 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
Re: PHP 7.2.0 Released
#70What 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?
Slack would, https://slack.engineering/taking-php-seriously-cf7a60065329