News for hackers. Stuff that matters.
Re:A look at modern PHP by tudorw on Tuesday May 05, 2020 @05:45AM (#23078199)
Symfony is an outstanding framework and a real pleasure to build with.
Re:A look at modern PHP by tasuki on Tuesday May 05, 2020 @06:15AM (#23078367)
I've moved on from PHP some 5 years ago. I'm not missing the language. But damn I'm missing Symfony!

I prefer Scala to PHP, the language is much more expressive. When you want to replace a bit of core functionality, in Symfony, you extend the desired class, add it to the dependency injection container, and you're done.

In the Play framework, I once wanted to make a one-line change to the routing. When it turned out I'd have to touch 30+ files which have hardcoded dependencies on each other, I quickly gave up.

Re:A look at modern PHP by http-teapot on Tuesday May 05, 2020 @10:10AM (#23080157)
This is exactly my experience as well. Moved from PHP to Scala about 6 years ago.

Symfony is absolutely amazing. For example, you can import a UserBundle from github, extend the original service class, change a couple of lines and then you have a fully functional user auth system without to rewrite/wire a bunch of things.

Although I don’t enjoy writing PHP anymore, I do miss how mature it is.

Re:A look at modern PHP by out_of_protocol on Tuesday May 05, 2020 @08:32AM (#23079293)
Check out Rails (ruby) and Phoenix (Elixir)(Rails' successor, personal favorite of mine). Many frameworks on many languages tried to mimic rails but most failed to achieve desired level of polishing/comfort/completeness/etc
Re:A look at modern PHP by piotrkubisa on Tuesday May 05, 2020 @08:55AM (#23079489)
The really nice thing of Symfony framework is database schema mapping and migrations, which have compatibility with numerous database systems and provides abstraction layer [0], that among many options of interfaces have quite handy YAML-formatted schema mapping [1]. Nothing extraordinary these days but it is really stable and simple to use.

[0]: https://symfony.com/doc/current/doctrine.html

[1]: https://www.doctrine-project.org/projects/doctrine-orm/en/2....

Re:A look at modern PHP by mnm1 on Tuesday May 05, 2020 @01:32PM (#23082536)
Do you ever profile doctrine? I found its overhead to be 10x the actual time of my average query. Most of the time is spent hydrating. I wonder how people can put up with such a level of performance reduction and still claim they are using decent tools.
Re:A look at modern PHP by pqb on Wednesday May 06, 2020 @05:04AM (#23089125)
Of course! I believe almost all PHP devs noticed, they have terrible slowdown by Doctrine and used XDebug to check where is the problem. I am not PHP dev anymore and I hope it has improved a lot since my last adventure with this ORM but I'd still advocate to not use it on client-facing interface - you can use Doctrine only for database management (CLI), while for web interface use raw PDO or equivalent (Eloquent). You can also use cache or transform page into static-site. Sky is the limit.
Re:A look at modern PHP by aosmith on Tuesday May 05, 2020 @10:21PM (#23087355)
Oh doctrine, those were the days... I spent a couple years working on a project that was eventually rewritten in rails because there was a memory leak that required restarting the server ever night via cron.
Re:A look at modern PHP by piotrkubisa on Wednesday May 06, 2020 @05:12AM (#23089161)
Yeah, PHP scripts in CRON, especially those using some relational database were my nemesis that time too. The nice thing, which in PHP 5.5 was introduced is generators, that almost completely resolved the problem with memory leakage in such scripts IMHO.

[0]: https://www.php.net/manual/en/language.generators.overview.p...

Re:A look at modern PHP by conradfr on Tuesday May 05, 2020 @09:56AM (#23080044)
I have a love/hat relationship with Symfony but it is a a very well run project, the attention to developer experience is very underrated.
Re:A look at modern PHP by tudorw on Tuesday May 05, 2020 @04:46PM (#23084852)
Must confess I do have a special hat for writing YAML :)