[wp-trac] [WordPress Trac] #62061: Prepare for PHP 8.4

WordPress Trac noreply at wordpress.org
Fri Sep 27 19:51:47 UTC 2024


#62061: Prepare for PHP 8.4
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:  (none)
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  6.7
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php-84 has-patch has-unit-tests      |     Focuses:  php-
  needs-dev-note                                 |  compatibility
-------------------------------------------------+-------------------------

Comment (by hellofromTonya):

 In [changeset:"59108" 59108]:
 {{{
 #!CommitTicketReference repository="" revision="59108"
 Code Modernization: Fix trigger_error() with E_USER_ERROR deprecation in
 WP_Test_Stream::open().

 PHP 8.4 deprecates the use of `trigger_errror()` with `E_USER_ERROR` as
 the error level, as there are a number of gotchas to this way of creating
 a `Fatal Error` (`finally` blocks not executing, destructors not
 executing).
 The recommended replacements are either to use exceptions or to do a hard
 `exit`.

 As this is a test-only class, do not have to take BC-breaks into account.

 Also, as this is a test helper, throwing a exception is the most
 appropriate solution.

 Reference:
 *
 https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error

 Follow-up to [49230].

 Props jrf.
 See #62061.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62061#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list