[wp-trac] [WordPress Trac] #49728: [PHP 8] Prepare for the internal functions throwing `TypeError` or `ValueError` exceptions on unexpected types/values

WordPress Trac noreply at wordpress.org
Thu Jun 13 12:53:33 UTC 2024


#49728: [PHP 8] Prepare for the internal functions throwing `TypeError` or
`ValueError` exceptions on unexpected types/values
-------------------------------------------------+-------------------------
 Reporter:  ayeshrajans                          |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.6
Component:  Build/Test Tools                     |     Version:
 Severity:  minor                                |  Resolution:
 Keywords:  needs-patch needs-unit-tests needs-  |     Focuses:
  dev-note php80 needs-docs                      |
-------------------------------------------------+-------------------------

Comment (by hugod):

 Hi @ayeshrajans,
 I've looked into your proposal trying to find an implementation. But I
 cannot find a case where we would want to override the current behavior of
 `expectedIncorrectUsage` annotation.

 As of today, it's mainly used to test `_doing_it_wrong` errors.

 So if a PHP error is raised in version greater than 8.0, I would expect
 the test to fail anyway because it would mean that the test is using
 broken code.

 For instance, if a test calls `strlen()` with an array, I expect it to
 fail right away with a `TypeError`.

 Do you have any case where your request could be applicable?

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


More information about the wp-trac mailing list