Description
Symfony version(s) affected: 4.4, 5.3, 5.4, 6.0
Description
In November, PHP 8.1 will be released and we should be prepared. In this PR, I'd like to track the efforts necessary to make all actively maintained branches ready for that release.
Ready means: if an application uses features of PHP 8.1, Symfony must not blow up.
We do already have a GitHub action that tests all branches with PHP 8.1. This action will always pass, but the output will show us if we're compatible yet: https://github.com/symfony/symfony/runs/2752054643
I will update this issue as we progress.
How to Contribute
If you want to join the effort, please start with the components and bridges. Fixing those will also fix many broken bundle tests. Reminder: We treat compatibility issues as bugs. As always, please fix bugs on the lowest maintained branch that suffers from the bug.
Progress
Components
- Asset
- BrowserKit
- Cache
- Config
- Console
- Fix incompatible implicit float-to-int conversions #41555
- Failing test:
ApplicationTest::testRenderExceptionWithDoubleWidthCharacters
- Failing test:
Symfony\Component\Console\Tests\Style\SymfonyStyleTest::testOutputs
- CssSelector
- Debug
- DependencyInjection
- ContainerBuilder::hash() is unstable when switching from PHP 8.0 to 8.1 #41592
- [DependencyInjection] Fix testServiceSubscriber for PHP 8.1 #41603
- Support for PHP 8.1 laminas/laminas-code#86
- [DependencyInjection] fix support for "new" in initializers on PHP 8.1 #43277
- [DependencyInjection] Cast tag attribute value to string #44639
- DomCrawler
- Dotenv
- ErrorHandler
- EventDispatcher
- ExpressionLanguage
- Filesystem
- Finder
- Form
- Add ReturnTypeWillChange where necessary doctrine/collections#277
- Failing test:
NumberToLocalizedStringTransformerTest
- [Form] Remove broken test case #42630
- HttpClient
- HttpFoundation
- [HttpFoundation] Handle new tentative return types #41626
- "false" pseudo type is not handled properly sebastianbergmann/type#15
- Add return types to JsonSerializable implementations #41556
- Failing test:
BinaryFileResponseTest::testSetContentDispositionGeneratesSafeFallbackFilename
- [HttpFoundation] Don't pass null to strpos() #42380
- [HttpFoundation] Remove implicit float to int cast #42783
- [HttpFoundation] Fix PHP 8.1 deprecation notice in IpUtils::checkIp() #43357
- HttpKernel
- Inflector
- Intl
- Ldap
- Lock
- Add ReturnTypeWillChange to PDO implementations doctrine/dbal#4662
- Failing test: SemaphoreStoreTest::testBlockingLocks
- Fix incompatible implicit float-to-int conversions #41555
- Add ReturnTypeWillChange predis/predis#706
- Mailer
- Messenger
- Mime
- Notifier
- OptionsResolver
- PasswordHasher
- Process
- PropertyAccess
- PropertyInfo
- RateLimiter
- Routing
- SecurityCore
- SecurityCsrf
- SecurityGuard
- SecurityHttp
- Serializer
- Semaphore
- Stopwatch
- String
- Templating
- Translation
- [Translation] Don't pass null to strtoupper() #41562
- Failing test:
PseudoLocalizationTranslatorTest::testTrans
- Uid
- Validator
- VarDumper
- VarExporter
- WebLink
- Workflow
- Yaml
Bridges
- Doctrine
- Add ReturnTypeWillChange to PDO implementations doctrine/dbal#4662
- Add ReturnTypeWillChange to core interface implementations doctrine/dbal#4734
- Add ReturnTypeWillChange to ReflectionEmbeddedProperty doctrine/orm#8742
- Add ReturnTypeWillChange to extended reflection classes doctrine/persistence#189
- Add ReturnTypeWillChange where necessary doctrine/collections#277
- Monolog
- PhpUnit
- ProxyManager
- Twig
Bundles
- DebugBundle
- FrameworkBundle
- [FrameworkBundle][WebProfilerBundle] Don't pass null to string parameters #41565
- Fix PHP 8.1 deprecations Masterminds/html5-php#207
- Fix Serializable deprecations triggered by token mocks #41554
- [DependencyInjection] Don't pass null to trim() #41557
- [DomCrawler] Don't pass
null
totrim()
#42768 - [Cache] Fix implicit float to int cast #42835
- SecurityBundle
- TwigBundle
- WebProfilerBundle
- WebServerBundle