[wp-trac] [WordPress Trac] #54730: PHP 8.x: various compatibility fixes for WordPress 6.0

WordPress Trac noreply at wordpress.org
Mon Jan 17 11:39:50 UTC 2022


#54730: PHP 8.x: various compatibility fixes for WordPress 6.0
-------------------------------------------------+-------------------------
 Reporter:  hellofromTonya                       |       Owner:  (none)
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  6.0
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php8 php81 has-patch has-unit-tests  |     Focuses:  coding-
                                                 |  standards
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 In [changeset:"52585" 52585]:
 {{{
 #!CommitTicketReference repository="" revision="52585"
 Upgrade/Install: Check if the `disk_free_space()` function exists before
 calling it.

 In PHP 8+, `@` no longer suppresses fatal errors:
 > The `@` operator will no longer silence fatal errors (`E_ERROR`,
 `E_CORE_ERROR`, `E_COMPILE_ERROR`, `E_USER_ERROR`, `E_RECOVERABLE_ERROR`,
 `E_PARSE`).

 Reference: [https://www.php.net/manual/en/migration80.incompatible.php PHP
 8: Backward Incompatible Changes].

 `disk_free_space()` may be disabled by hosts, which will throw a fatal
 error on a call to undefined function.

 This change prevents the fatal error, and falls back to `false` when
 `disk_free_space()` is unavailable.

 Follow-up to [25540], [25774], [25776], [25831], [25869].

 Props costdev, jrf, swb1192, SergeyBiryukov.
 Fixes #54826. See #54730.
 }}}

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


More information about the wp-trac mailing list