[wp-trac] [WordPress Trac] #54780: Site Health Info => Returns a fatal error in php 8.0

WordPress Trac noreply at wordpress.org
Sat Jan 15 20:25:27 UTC 2022

#54780: Site Health Info => Returns a fatal error in php 8.0
 Reporter:  alfredo49         |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Site Health       |     Version:  5.8.3
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch php8  |     Focuses:  administration

Comment (by SergeyBiryukov):

 Replying to [comment:8 costdev]:
 > That's strange. There's a `function_exists( 'exec' )` condition to
 prevent line 663 being hit if `exec` has been disabled. However, a quick
 google search suggests that on some hosts, a disabled function can return
 `true` for `function_exists()`, yet cannot be called.

 Related: comment:116:ticket:51857:
 > Per the [https://www.php.net/manual/en/function.function-
 exists.php#67947 comments in the PHP manual], `function_exists()` should
 return `false` for functions disabled via `disable_functions` setting.
 > As also noted in comment:3:ticket:42085, it is possible for the
 `function_exists()` check to return `true` if Suhosin is in use. However,
 that would be an edge case, as Suhosin was only officially available for
 PHP 5.4 to 5.6, and its development was discontinued in 2015.
 > It's also worth noting that as of PHP 8, disabled functions can be
 redeclared. Unless the function is redeclared, `function_exists()` still
 returns `false`.
 > It looks like most of the instances in core where we need to check for a
 function that might be disabled just use a simple `function_exists()`

Ticket URL: <https://core.trac.wordpress.org/ticket/54780#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list