Problem/Motivation
Make sure Drupal keeps being compatible with PHP 8. Work with dependencies as needed. See #3086374: Make Drupal 8 & 9 compatible with PHP 7.4 for how we did it with PHP 7.4. PHP 8.0 is feature frozen and beta4 is out, see https://www.php.net/archive/2020.php#2020-09-17-1
Proposed resolution
The following task list has been determined by testing on #3156595: Make Drupal 9 installable on PHP8.
1. Dependency updates to support PHP 8
To produce a list of dependencies that are blocking PHP 8 support, you can do the following. Make sure you use PHP 7.4+ to run it.
$ git clone --branch 9.1.x https://git.drupalcode.org/project/drupal.git whynotphp8
$ cd whynotphp8/
$ composer install
$ composer update
$ composer why-not php:8
Dependency | Links |
---|---|
fabpot/goutte 3.3.0 | Possibly #3176655: Use Behat\Mink\Driver\BrowserKitDriver directly instead of GoutteDriver for PHP 8 compatibility or if that does not work out https://github.com/FriendsOfPHP/Goutte/issues/429 |
laminas/laminas-diactoros 2.4.1 | https://github.com/laminas/laminas-diactoros/pull/46 |
laminas/laminas-escaper 2.6.1 | https://github.com/laminas/laminas-escaper/issues/8 |
laminas/laminas-feed 2.12.3 | https://github.com/laminas/laminas-feed/issues/27 |
typo3/phar-stream-wrapper 3.1.5 | https://github.com/TYPO3/phar-stream-wrapper/issues/64 https://github.com/TYPO3/phar-stream-wrapper/pull/65 |
Additionally to the composer reported dependencies above:
- behat/mink-selenium2-driver - https://github.com/minkphp/MinkSelenium2Driver/pull/320
2. Drupal issues that can be addressed in Drupal 9 today
These issues can proceed without worrying about the how and if vendor support works for PHP 8 since the changes are all PHP 7 compatible. We can keep the changes PHP 7.0 compatible to make things easy for Drupal 8.
- #3176655: Use Behat\Mink\Driver\BrowserKitDriver directly instead of GoutteDriver for PHP 8 compatibility
- #2736777: MySQL on PHP 8 now errors when committing or rolling back when there is no active transaction
3. Drupal issues that need a largely working PHP 8 build to test
- None
DONE
- In/with dependencies:
- symfony/*, twig/twig, composer/* #3156558: Upgrade dependencies prior to 9.1.0 and #3157296: Upgrade dependencies prior to 9.1.0
- Update symfony contract php requirement - https://github.com/symfony/symfony/pull/37494
- phpspec/prophecy - https://github.com/phpspec/prophecy/pull/470
- phpdocumentor/reflection-docblock - https://github.com/phpDocumentor/ReflectionDocBlock/pull/240
- Symfony CMF #3176576: Update to Symfony CMF 2.3.3
- #3127141: Use PHPUnit 9 for PHP 7.4+, while keeping support for PHPUnit 8.4 in PHP 7.3 and #3128631: Update dependencies composer/composer ^2 and composer/semver to ^3
- doctrine/reflection - #3179284: Update dependencies for Drupal 9.1 and 9.2
- Within Drupal itself:
- #3174928: Improve the stability of core JS testing and prepare for update of MinkSelenium2Driver (this is not compatibility but we can't update to the latest MinkSelenium2Driver without it)
- #3156887: \Drupal\system\Plugin\ImageToolkit\GDToolkit needs to support \GdImage objects for PHP 8 compatibility
- #3177541: stream_open() needs to cope with a failure in \Drupal\Core\StreamWrapper\LocalStream::getLocalPath() better
- #3178998: Update error types and messages for PHP 8
- #3179013: EntityRouteEnhancerTest has a meaningless assertion that breaks in PHP 8
- #3177557: \Drupal\error_test\Controller\ErrorTestController::generateWarnings() notice is not a notice in PHP 8
- #3177545: \Drupal\field\Entity\FieldStorageConfig::getCardinality() needs to be more type safe
- #3177546: \Drupal\views\Plugin\views\PluginBase::listLanguages() incorrectly uses in_array() resulting in listing additional languages
- #3177590: ViewsFormBase::getForm() re-uses $key and relies on odd PHP 7 behaviour
- #3156542: \ReflectionParameter::getClass() is deprecated in PHP 8.0
- #3174662: Encapsulate \PDOStatement instead of extending from it
- #3156944: Support nullable typehints and return types in ProxyBuilder and as a result support PHP 8
- #3156878: \Drupal\Component\Datetime\DateTimePlus should pass correct parameter types to checkdate()
- #3156885: Change \Drupal\error_test\Controller\ErrorTestController::generateWarnings() to throw E_NOTICE error compatible with PHP 8
- #3156879: \Drupal\Component\Utility\Bytes::toInt() - ensure $size is a number type
- #3156882: \Drupal\Core\Render\Element\StatusReport::preRenderGroupRequirements() and \Drupal\user\PermissionHandler::sortPermissions() sorts return bools
- #3156883: \Drupal\Core\Url ensure fragment is not an empty string
- #3170648: CKEditorPluginManager::getEnabledButtons throws warnings on PHP 8.0.0 beta3
- #3173958: PHP 8 error: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
- #3173888: Error handler signature changed in PHP 8
- #3174038: ZipArchive::open(): Using empty file as ZipArchive is deprecated in PHP 8
- #3173991: Incorrect passby reference use in anonymous functions
- #3174158: Division by zero is not warning since PHP 8.0 beta4
- #3174022: call_user_func_array() and named arguments in PHP 8
Remaining tasks
See above.
User interface changes
None.
API changes
Data model changes
None.