Discus adoption of #NoDiscard and PHP 8.5

Created on 9 May 2025, 6 months ago

Problem/Motivation

Post 11.2 release PHP 8.5 will begin to 3 month to RC stage but some RFC are already merged
There's symfony/polyfill-php85 could be added with NoDiscard RFC for batching

https://wiki.php.net/rfc/marking_return_value_as_important

Steps to reproduce

https://github.com/symfony/polyfill-php85

Proposed resolution

As CI already running 8.5 enable the polyfill

Remaining tasks

- discus adoption of PHP 8.5 as the first alpha Jul 03 2025

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

base system

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @andypost
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    added list of implemented https://wiki.php.net/rfc#php_85

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States xjm
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States xjm
  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    I did not mean to open a forkโ€ฆ must have tapped something inadvertently.

  • Merge request !12877Draft: Resolve #3523596 "Php 8.5 testing" โ†’ (Open) created by andypost
  • Pipeline finished with Canceled
    3 months ago
    Total: 468s
    #561035
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    First Phpstan error on 8.5 alpha3

         Internal error: AST failed to parse in located source (line 3): Syntax                             
         error, unexpected T_CLONE, expecting T_EXIT or T_STRING or T_READONLY or                           
         '(', Syntax error, unexpected T_VARIABLE, Syntax error, unexpected ')'                             
                                                                                                            
         <?php                                                                                              
                                                                                                            
         function clone(object $object, array $withProperties = []): object                                 
         {                                                                                                  
         }                                                                                                  
          while analysing file                                                                              
         /builds/issue/drupal-3523596/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php  
  • Pipeline finished with Failed
    3 months ago
    #561049
  • Pipeline finished with Failed
    3 months ago
    Total: 603s
    #568068
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    The ToolkitGdTest test fails probably because of

    - https://github.com/php/php-src/pull/17375
    - https://github.com/php/php-src/pull/19107

         โœ˜ Manipulations with 29
           โ”
           โ”œ Image 'image-test.gif' object after 'rotate_5' action has the correct color placement at corner '0' - Actual: {255,0,93,0}, Expected: {255,0,255,0}, Distance: 26244, Tolerance: 0
           โ”œ Failed asserting that 26244 is equal to 0 or is less than 0.             
           โ”‚
           โ”‚ /builds/issue/drupal-3523596/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:90
           โ”‚ /builds/issue/drupal-3523596/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:357
           โ”ด
         โœ˜ Manipulations with 30
           โ”
           โ”œ Image 'image-test.gif' object after 'rotate_transparent_5' action has the correct color placement at corner '0' - Actual: {255,93,0,46}, Expected: {255,255,255,127}, Distance: 97830, Tolerance: 0
           โ”œ Failed asserting that 97830 is equal to 0 or is less than 0.             
           โ”‚
           โ”‚ /builds/issue/drupal-3523596/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:90
           โ”‚ /builds/issue/drupal-3523596/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php:357
           โ”ด
  • Pipeline finished with Failed
    3 months ago
    #568253
  • Pipeline finished with Failed
    3 months ago
    #568270
  • Pipeline finished with Failed
    3 months ago
    #568272
  • Pipeline finished with Failed
    3 months ago
    #568280
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Filed issue for the test ๐Ÿ› Fix ToolkitGdTest n PHP 8.5 Active

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Also created 2 fixes for commited deprecations (will be released on August 13)

    ๐Ÿ“Œ Remove remaining usage of setAccessible() Active
    ๐Ÿ“Œ Clean-up deprecated non-standard cast names Active

  • Pipeline finished with Failed
    3 months ago
    Total: 2931s
    #571256
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    A bit more deprecations

    php message: PHP Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in /var/www/html/web/vendor/react/promise/src/functions.php on line 300

    https://github.com/reactphp/promise/commit/d3998c8a5d3cff0b39b2f332da550...

    php message: Failed to log error: Deprecated function: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0 in GuzzleHttp\Handler\CurlFactory->__destruct() (line 732 of /var/www/html/web/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php). #0 /var/www/html/web/core/includes/bootstrap.inc(104): _drupal_error_handler_real()
    #1 /var/www/html/web/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(732): _drupal_error_handler()
    #2 [internal function]: GuzzleHttp\Handler\CurlFactory->__destruct()
    #3 {main}
    

    need new issue for guzzle

  • Pipeline finished with Failed
    3 months ago
    #571484
  • Pipeline finished with Failed
    3 months ago
    #571494
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    https://github.com/nikic/PHP-Parser/commit/02dcdd74bb328ca0bd9b9e459ca25...

    and one more

    vendor/sebastian/recursion-context/src/Context.php:148
        Method SplObjectStorage::contains() is deprecated since 8.5, use method SplObjectStorage::offsetExists() instead
  • Pipeline finished with Failed
    3 months ago
    #571507
  • Pipeline finished with Running
    3 months ago
    #571517
  • Pipeline finished with Failed
    3 months ago
    #571530
  • Pipeline finished with Failed
    3 months ago
    #571547
  • Pipeline finished with Failed
    3 months ago
    #571555
  • Pipeline finished with Failed
    3 months ago
    #571564
  • Pipeline finished with Failed
    3 months ago
    Total: 665s
    #571881
  • Pipeline finished with Failed
    3 months ago
    Total: 1139s
    #571922
  • Pipeline finished with Failed
    3 months ago
    Total: 416s
    #572286
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Updated IS with curent state

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost
  • Pipeline finished with Failed
    2 months ago
    Total: 991s
    #573905
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    @andypost now ๐Ÿ“Œ Bump PHPUnit to ^11.5.32 with all dependencies for testing with PHP 8.5 Active fixes some of the dependencies telated issues

  • Pipeline finished with Failed
    2 months ago
    Total: 727s
    #575719
  • Pipeline finished with Failed
    2 months ago
    Total: 739s
    #576953
  • Pipeline finished with Failed
    2 months ago
    Total: 469s
    #576960
  • Pipeline finished with Failed
    2 months ago
    Total: 429s
    #576970
  • Pipeline finished with Failed
    2 months ago
    Total: 722s
    #576973
  • Pipeline finished with Failed
    2 months ago
    #579135
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Filed separare issue for Guzzle upgrade ๐Ÿ“Œ Upgrade Guzzle to 7.10 for PHP 8.5 support Active

  • Pipeline finished with Failed
    2 months ago
    #580470
  • Pipeline finished with Failed
    2 months ago
    Total: 963s
    #582429
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Beta2 is tagged and all tests fail again because PDO constants are deprecated

        1 test triggered 3 PHP deprecations:
        
        1) /builds/issue/drupal-3523596/core/modules/mysql/src/Driver/Database/mysql/Connection.php:124
        Constant PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is deprecated since 8.5, use Pdo\Mysql::ATTR_USE_BUFFERED_QUERY instead
        
        Triggered by:
        
        * Drupal\Tests\workflows\Kernel\ComplexWorkflowTypeTest::testLoadMultipleByType
          /builds/issue/drupal-3523596/core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php:27
        
        2) /builds/issue/drupal-3523596/core/modules/mysql/src/Driver/Database/mysql/Connection.php:128
        Constant PDO::MYSQL_ATTR_FOUND_ROWS is deprecated since 8.5, use Pdo\Mysql::ATTR_FOUND_ROWS instead
        
        Triggered by:
        
        * Drupal\Tests\workflows\Kernel\ComplexWorkflowTypeTest::testLoadMultipleByType
          /builds/issue/drupal-3523596/core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php:27
        
        3) /builds/issue/drupal-3523596/core/modules/mysql/src/Driver/Database/mysql/Connection.php:133
        Constant PDO::MYSQL_ATTR_MULTI_STATEMENTS is deprecated since 8.5, use Pdo\Mysql::ATTR_MULTI_STATEMENTS instead
        
        Triggered by:
        
        * Drupal\Tests\workflows\Kernel\ComplexWorkflowTypeTest::testLoadMultipleByType
          /builds/issue/drupal-3523596/core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php:27
  • Pipeline finished with Failed
    2 months ago
    Total: 817s
    #582435
  • Pipeline finished with Canceled
    2 months ago
    Total: 294s
    #582972
  • Pipeline finished with Failed
    2 months ago
    Total: 713s
    #582980
  • Pipeline finished with Failed
    2 months ago
    Total: 150s
    #583012
  • Pipeline finished with Failed
    2 months ago
    Total: 304s
    #583024
  • Pipeline finished with Failed
    2 months ago
    Total: 166s
    #583032
  • Pipeline finished with Failed
    2 months ago
    Total: 144s
    #583037
  • Pipeline finished with Failed
    2 months ago
    Total: 147s
    #583041
  • Pipeline finished with Failed
    2 months ago
    Total: 173s
    #583064
  • Pipeline finished with Failed
    2 months ago
    Total: 150s
    #583082
  • Pipeline finished with Failed
    2 months ago
    Total: 823s
    #583490
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    I think we should open a new issue to discuss #NoDiscard so retitling this one.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Updated MR status in the issue summary a bit. It looks like justinrainbow/json-schema is planning to do a release tomorrow, if we're able to update to that next week then I think that will get us to clean phpunit test runs on PHP 8.5

    @andypost are there already issues open for the remaining core changes like the mysql driver?

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    I need to file new issues for mysql, migrate and chr(), probably last 2 could be done in one task

    The biggest challenge is ๐Ÿ› Fix ToolkitGdTest n PHP 8.5 Active

    PS: once justinrainbow/json-schema will be merged, composer should create another release and it will fix package manager tests

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    updated IS with new releases

  • Pipeline finished with Failed
    2 months ago
    Total: 706s
    #584726
  • Pipeline finished with Failed
    2 months ago
    Total: 469s
    #585373
  • Pipeline finished with Failed
    2 months ago
    Total: 657s
    #585387
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Waiting for next composer release

    https://github.com/composer/composer/pull/12517

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    The #Deprecated attribute now allowed for traits to deprecate https://github.com/php/php-src/commit/34a6e86282508d3b3c592d7156727204aa...

  • Pipeline finished with Failed
    about 2 months ago
    Total: 766s
    #594320
  • Pipeline finished with Failed
    about 2 months ago
    Total: 746s
    #597404
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 72s
    #597438
  • Pipeline finished with Failed
    about 2 months ago
    Total: 171s
    #597439
  • Pipeline finished with Failed
    about 2 months ago
    Total: 171s
    #597441
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 247s
    #597453
  • Pipeline finished with Failed
    about 2 months ago
    Total: 198s
    #597463
  • Pipeline finished with Failed
    about 2 months ago
    Total: 145s
    #597471
  • Pipeline finished with Failed
    about 2 months ago
    Total: 141s
    #597472
  • Pipeline finished with Failed
    about 2 months ago
    Total: 176s
    #597473
  • Pipeline finished with Failed
    about 2 months ago
    Total: 156s
    #597479
  • Pipeline finished with Failed
    about 2 months ago
    Total: 656s
    #597480
  • Pipeline finished with Failed
    about 2 months ago
    Total: 819s
    #597491
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 200s
    #597497
  • Pipeline finished with Failed
    about 2 months ago
    Total: 533s
    #597500
  • Pipeline finished with Failed
    about 2 months ago
    Total: 261s
    #597502
  • Pipeline finished with Canceled
    about 2 months ago
    #597507
  • Pipeline finished with Failed
    about 2 months ago
    Total: 628s
    #597508
  • Pipeline finished with Failed
    about 2 months ago
    Total: 737s
    #597775
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 242s
    #597789
  • Pipeline finished with Failed
    about 2 months ago
    Total: 253s
    #597790
  • Pipeline finished with Failed
    about 2 months ago
    Total: 917s
    #597792
  • Pipeline finished with Failed
    about 2 months ago
    Total: 146s
    #597802
  • Pipeline finished with Failed
    about 2 months ago
    Total: 292s
    #597807
  • Pipeline finished with Failed
    about 1 month ago
    Total: 780s
    #597811
  • Pipeline finished with Failed
    about 1 month ago
    Total: 253s
    #598253
  • Pipeline finished with Failed
    about 1 month ago
    Total: 160s
    #598257
  • Pipeline finished with Failed
    about 1 month ago
    Total: 235s
    #598261
  • Pipeline finished with Failed
    about 1 month ago
    Total: 830s
    #598272
  • Pipeline finished with Failed
    about 1 month ago
    Total: 277s
    #598277
  • Pipeline finished with Failed
    about 1 month ago
    Total: 722s
    #598279
  • Pipeline finished with Failed
    about 1 month ago
    Total: 232s
    #598283
  • Pipeline finished with Failed
    about 1 month ago
    Total: 672s
    #598289
  • Pipeline finished with Failed
    about 1 month ago
    Total: 282s
    #598301
  • Pipeline finished with Failed
    about 1 month ago
    Total: 346s
    #598308
  • Pipeline finished with Failed
    about 1 month ago
    Total: 883s
    #598313
  • Pipeline finished with Failed
    about 1 month ago
    Total: 161s
    #598328
  • Pipeline finished with Failed
    about 1 month ago
    Total: 532s
    #598330
  • Pipeline finished with Failed
    about 1 month ago
    #603633
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1544s
    #607152
  • Pipeline finished with Failed
    about 1 month ago
    Total: 192s
    #607201
  • Pipeline finished with Failed
    about 1 month ago
    Total: 268s
    #607212
  • Pipeline finished with Failed
    about 1 month ago
    Total: 280s
    #607216
  • Pipeline finished with Failed
    about 1 month ago
    Total: 382s
    #607224
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1465s
    #607236
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1350s
    #609152
  • Pipeline finished with Failed
    24 days ago
    Total: 1436s
    #618231
  • Pipeline finished with Failed
    24 days ago
    Total: 169s
    #618323
  • Pipeline finished with Failed
    24 days ago
    Total: 1557s
    #618325
  • Pipeline finished with Failed
    21 days ago
    Total: 746s
    #620917
  • Pipeline finished with Failed
    21 days ago
    Total: 941s
    #620914
  • Pipeline finished with Canceled
    20 days ago
    Total: 473s
    #622272
  • Pipeline finished with Failed
    20 days ago
    Total: 469s
    #622278
  • Pipeline finished with Failed
    20 days ago
    Total: 889s
    #622319
  • Pipeline finished with Failed
    18 days ago
    Total: 1141s
    #624612
  • Pipeline finished with Failed
    11 days ago
    Total: 6456s
    #631109
  • Pipeline finished with Running
    5 days ago
    Total: 727s
    #637225
  • Pipeline finished with Failed
    about 13 hours ago
    Total: 653s
    #641628
Production build 0.71.5 2024