Symfony 20 year!
This year, Symfony celebrates its 20 year anniversary. Let’s dive into some statistics of years of making web development history.
Read more [wouterj.nl]
Posts tagged with symfony
This year, Symfony celebrates its 20 year anniversary. Let’s dive into some statistics of years of making web development history.
Read more [wouterj.nl]
Tests performed by Tideways show that, in general, the performance between 8.2, 8.3 and 8.4 does not move much for a Laravel, Symfony and WordPress demo application.
Read more [tideways.com]
Join 9,500+ smart developers
Every month I share what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
"Freek publishes a super resourceful and practical newsletter. A must for anyone in the Laravel space"
No spam. Unsubscribe anytime. You can also follow me on X.
Let's take a look how we can extend Var Dumper to dump our objects, or some vendor objects, in a more readable way.
Read more [jolicode.com]
I'm sure Tomas is going to do some cool stuff for the Laravel community.
Read more [tomasvotruba.com]
I think this is great news.
Read more [symfony.com]
Ignition is the most beautiful error page for PHP apps. Yesterday, we launched a new major version of Ignition - you can check out all the details in this blog post.
Ignition used to be Laravel specific, but we've now created a framework agnostic version as well. Let's try using Ignition in a simple Symfony app.
The main thought behind hexagonal architecture is that by isolation the core logic of your app, adding more inputs (like an API or console app) or outputs becomes much easier. Here's a cool talk Mattias Noback gave a few years ago at SymfonyLive on the topic.
Getting to know another framework and community can be a daunting task. But in case of Symfony it proves not to be that hard. On his blog Matthew Setter shares his first steps into Symfony.
Recently, I decided to learn the basics of the Symfony (4) framework, so that I could better understand one of my client's applications, and provide better support to it. I never expected to use such a well-rounded framework. Nor did I expect to encounter such an engaged and supportive community. Here's the story.
https://www.matthewsetter.com/first-experience-with-symfony/
In an article on his Medium blog, Jerzy Zawadzki wrote about the most important changes made in Symfony 4.
Internally, Symfony 4.0 is “just” Symfony 3.4 with removed depracations. But from outside there is a big leap forward. Most changes (from the installation process, directory structe through using bundles, to coding itself) were made to improve Developer Experience with the framework. Such system like Symfony, which can be used to create web apps as easily as to build other frameworks on top of it, must be complicated. But, as Symfony proves in new version, this complexity may be ‘hidden’ from the developer eyes.
https://medium.com/@zawadzki.jerzy/symfony-4-new-hope-dbf99dde91d8
Let's talk a little bit about Symfony's dump function. It's part of their VarDumper component. The function can dump a variable to the screen or browser in a nicer format than PHP's native var_dump. In the recently released Symfony 3.4 and Symfony 4 the function got a nice little improvement that…
In a recent interview published on the Cloudways blog Taylor Otwell shares his thoughts on the similarities differences between Laravel and Symfony.
Both Laravel and Symfony are more rapid than building an entire PHP application from scratch. So, in that sense, they both allow rapid application development. However, Laravel does make strong efforts to have a very clean and productive working environment for building applications of all sizes. I think Symfony has also made efforts in this direction over the last few years with their “DX” initiatives and some of the more opinionated things they are doing with Symfony Flex.
On his blog Frank De Jonge explains how he solved a performance problem in one of his projects.
Last week I took a deep dive into Symfony's Routing Component. A project I worked on suffered from a huge performance penalty caused by a routing mistake. This lead me on the path to discovering some interesting performance considerations. Some common practices align nicely with Symfony's optimisations, let's look into those.
https://blog.frankdejonge.nl/symfony-routing-performance-considerations/
According to Fabien Potencier, lead of the Symfony project, the next major version of Symfony, to be released at then end of 2017, will require PHP 7.
#Symfony 4 (to released in November 2017) will drop #PHP 5 support... So, #Twig 2 stable should probably supports PHP 7 only, right?
— Fabien Potencier (@fabpot) December 16, 2016
But Laravel will drop PHP 5 support even sooner. Taylor Otwell, the creator of Laravel, announced that Laravel 5.5, to be released in June 2017, will leave PHP 5 behind.
Laravel 5.5 in July 2017 will require PHP 7+ ?
— Taylor Otwell (@taylorotwell) December 16, 2016
On multiple occasions Taylor et co. have stated that they don't like the strictness that things like scalar and return type hints bring to the table. So I don't expect to see them appear much in Laravel codebase. Smaller syntax improvements like for example the null coalescing operator will almost certainly be used.
A few weeks ago Jordi Boggiano reported that only a miserable 3% of all packages present on Packagist require PHP 7. The best thing about Symfony and Laravel dropping PHP 5 support is that it will send a strong message throughout the entire PHP ecosystem that you shouldn't bother with PHP 5 code anymore. When creating new projects and packages more developers will target PHP 7 as a minimum version as well.
For our PHP and Laravel packages we left PHP 5 behind as soon as PHP 7 was available. Our packages already make extensive use of return type hints, anonymous classes and the null coalescing operator to create more readable (and thus more maintainable) code.
(Fun Scary fact: Wordpress only requires PHP 5.2 ?)
Joeri Verdeyen, a developer at Yappa, explains how you can use some Symfony components in a legacy application.
Symfony Components are a set of decoupled and reusable PHP libraries. They are becoming the standard foundation on which the best PHP applications are built. You can use any of these components in any of your applications independently from the Symfony Framework.The purpose of this post is to roughly describe how to implement some of the Symfony Components.
http://tech.yappa.be/symfony-components-in-a-legacy-php-application
Alternatively if you want to use Laravel's Illuminate components, check out Matt Stauffer's Torch repository on GitHub.
When creating output from a Symfony based console command you might have created a title using code like this:
$output->writeln('');
$output->writeln('<info>Lorem Ipsum Dolor Sit Amet</>');
$output->writeln('<info>==========================</>');
$output->writeln('');
Starting from Symfony 2.7 there's a nice way to style the output of console commands. This code produces the same output as the example above
$io = new SymfonyStyle($input, $output)
$io->title('Lorem Ipsum Dolor Sit Amet');
There are styles for titles, sections, questions, tables, and so on. Take a look at the documention to learn what's possible.
HTTP/2 has a great feature called server push. It enables the server to send multiple responses in parallel for one request. In a blogpost on the Symfony Finland blog Jani Tarvainen demonstrates how to make use of server push with the Symfony Kernel.
$app->get('/images'), function () use ($app) {
$images = array('/images/1.jpg','/images/2.jpg','/images/3.jpg');
$response = new JsonResponse($images);
foreach($images as $image){
$response->headers->set('link','<' . $image . '>; rel=preload; as=image',false);
}
return $response;
Read the entire article for some more background info.
This chart shows the number of requests per second that were performed (more is better). You can see that PHP 7 can do a lot more in comparison with the other versions. Response times drop from 0.2269 to 0.0865 seconds in the production environment.http://www.intracto.com/nl/blog/running-symfony2-on-php7
Nice benchmark-work by Tom Van Looy. It is clear that you'll benefit from impressive speed bumps when upgrading to the next major version of PHP. Tom also provides instructions on how to setup PHP7 so you can perform your own tests.