Black Friday 2021 Offers 30% discount on Certification, Coaching, and SymfonyInsight Teams subscriptions

Symfony achieves 100% PHP7 compatibility

PHP7, the new version of the programming language Symfony is built with, will be released at the end of the year. The recent release of its third beta has brought us another step closer to the final stable release.

During these last past months, we've been working very hard to achieve full PHP7 compatibility. This effort accelerated during the past weeks and we're glad to announce that all Symfony maintained branches are now 100% compatible with PHP7.

Our PHP7 compatibility journey started on February 2015, when Nicolas Grekas added php: nightly to the list of tested PHP engines on Travis CI (see commit). After that, a lot of pull requests followed to fix PHP7 compatibility for Symfony components.

Some of these changes were related to the new reserved keywords, which prevents you from using int, float, bool, string, true, false and null as the name of your classes (see PR #14472). This forced us to rename the Null, True and False constraints (see PR #14228).

Another big change was related to the new Throwable interface introduced by PHP7 and which is implemented by all the internal error and exception classes. Our exception handler needed to be updated for this new interface (see PR #14959).

Lastly, we've just removed php: nightly from the list of PHP engines which can silently fail. This means that Symfony no longer accepts changes that break PHP7 compatibility, not even in the master branch where the upcoming Symfony 3 is being developed.

Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.


Great job everyone!
वाह । सिम्फोनी से यही उम्मीद थी ।
Wow. This was expected from Symfony .
Keep up the good work !
Nice work. Congratulations to all contributors.
It's 100% php7 compatibility on test suite with BC on 2.X for some classes to be precise. It's a good announcement but as far as I know, all others projects that depend on Symfony are *not* PHP7 compatibles, for instance we have some issues with HTTP Foundation in BackBee. This announcement may be too optimistic in my opinion...
Hooray team! Perfect!
Great achievement! It opens so great new opportunities with strong scalar type hints, performance optimization, better error handling etc. Thanks for the hard work guys ;)
Good to see you do a great job to make the Symfony one of the best frameworks to work. Thank you.
Great News! congratulation team
Nice. Good Job Symfony.
This is quality team, adjusting the tools to language, congratulations and thanks!
Hindi:सिम्फोनी मस्त है भाई।
English:Symfony is awesome bro.
Nice, Thank you! :)
As we expect from a great framework. well done.
Great job, heartfelt thanks for the team.
I found a BUG entity generation, testing is symfony2.7 specific code location:. Vendor / doctrine / doctrine-bundle / mapping / DisconnectedMetadataFactory.php 119 line
$ all [0] -> name should be changed to $ all [0] -> namespace

Yml files so that multiple entities operating normally generate code to generate Repository.php
repositoryClass: SharedModel\TestRepository
php app / console doctrine: generate: entities
Updated code:
public function findNamespaceAndPathForMetadata(ClassMetadataCollection $metadata, $path = null)
$all = $metadata->getMetadata();
if (class_exists($all[0]->namespace)) {
$r = new \ReflectionClass($all[0]->namespace);
$path = $this->getBasePathForClass($r->getName(), $r->getNamespaceName(), dirname($r->getFilename()));
} elseif (!$path) {
throw new \RuntimeException(sprintf('Unable to determine where to save the "%s" class (use the --path option).', $all[0]->name));

$metadata->setNamespace(isset($r) ? $r->getNamespaceName() : $all[0]->namespace);
When i try to switch engines from twig to php, it is not working with php..
"The service "twig" has a dependency on a non-existent service "assetic.twig_extension"." this is the error that i got...

any help?
Great job! Congratulations to all in team..
Symfony rocks!
Good job guys! Symfony is hands down the best PHP framework out there! We cant wait to upgrade to 7!!!

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.