[wp-trac] [WordPress Trac] #56516: calendar_week_mod function is not type safe

WordPress Trac noreply at wordpress.org
Tue Sep 6 21:35:35 UTC 2022


#56516: calendar_week_mod function is not type safe
--------------------------------------------+------------------------------
 Reporter:  dingo_d                         |       Owner:  (none)
     Type:  defect (bug)                    |      Status:  new
 Priority:  normal                          |   Milestone:  Awaiting Review
Component:  General                         |     Version:  trunk
 Severity:  normal                          |  Resolution:
 Keywords:  needs-patch needs-testing php8  |     Focuses:
--------------------------------------------+------------------------------

Comment (by malthert):

 I think this is not an issue. The docs state the arg must be int. If you
 pass a non-int argument, it's expected to a warning/fatal, just like with
 many regular PHP functions (e.g. pass a string to array_pop and you'll get
 the same thing)

 Given the instrumentation modern PHP gives (strict types,...) I think it's
 not worth to cover every aspect and add tons of redundant conditions, that
 are flagged by every basic CI under the sun anyway.

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


More information about the wp-trac mailing list