[wp-trac] [WordPress Trac] #51894: PHP 8: Invalid functions added to hooks now cause fatals

WordPress Trac noreply at wordpress.org
Tue Dec 1 17:05:10 UTC 2020


#51894: PHP 8: Invalid functions added to hooks now cause fatals
-------------------------------------------+---------------------
 Reporter:  dlh                            |       Owner:  (none)
     Type:  enhancement                    |      Status:  new
 Priority:  normal                         |   Milestone:  5.6
Component:  Plugins                        |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  php8 has-patch has-unit-tests  |     Focuses:
-------------------------------------------+---------------------

Comment (by DavidAnderson):

 I agree with knutsp and TimothyBlynJacobs. The common mindset in the PHP
 world that fatal errors must not be allowed to occur at almost any cost,
 is harmful. PHP 8 is doing more to combat this anti-pattern. If there's
 code that intends to call a function/method, but that function/method is
 not available, then part of the program is missing. Safe or consistent
 execution can no longer be guaranteed. An exception should be raised
 rather than trying to make the best of it. This may cause a few more white
 screens in the short term as bad code is unearthed, but will improve the
 quality of the program and therefore experience in the long term.

 c.f. This post-mortem of a critical remote code execution vulnerability
 fixed in WP core 4.7.2, which would not have occurred if an abort had been
 allowed once safe/consistent execution was no longer possible (see
 particularly under 9.) -
 https://lukeplant.me.uk/blog/posts/wordpress-4.7.2-post-mortem/

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


More information about the wp-trac mailing list