[wp-trac] [WordPress Trac] #55194: wp_rand( 0, 0) result in random integer

WordPress Trac noreply at wordpress.org
Fri Feb 18 19:03:59 UTC 2022


#55194: wp_rand( 0, 0)  result in random integer
--------------------------+---------------------
 Reporter:  mlajo         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.0
Component:  General       |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  docs
--------------------------+---------------------

Comment (by azouamauriac):

 Replying to [comment:9 SergeyBiryukov]:
 >
 > Just out of curiousity, what would be the use case for a `wp_rand( 0, 0
 )` call?

 may be $min and $max are dynamiques variables, then it can happen that
 both of them get 0 as value, if that wp_rand will not given expected
 result... that's my mind... let's @mlajo enlighten us.

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


More information about the wp-trac mailing list