Upgrade Twig to support PHP 8.0/8.1 #2640
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related:
Issue
In order to make Timber 1 compatible with PHP 8 and 8.1, we need to upgrade Twig as well. Together with making Twig compatible with PHP 8, they also dropped support for PHP 7.1 in Twig 1.44.0.
Solution
We can make PHP 7.2.5 the minimum required PHP version for Timber. In the plugin, we can use the
Requires PHP
header to make sure that the plugin isn’t updated without any checks.Usually, an update shouldn’t even show up if the minimum PHP version or the required WordPress version isn’t met.
Impact
No support for PHP version < 7.2.
Usage Changes
None.
Considerations
Can’t think of any yet.
Testing
Testing is provided by @nlemoine in #2638.