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

WordPress Trac noreply at wordpress.org
Fri Feb 18 10:38:16 UTC 2022


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

Comment (by swissspidy):

 Ryan is not really active anymore, so I doubt you'll get a response :-)

 The function does not really support `$max = 0`. `$max = 0` means use the
 maximum upper bound, which is 4294967295.

 So this works as expected.

 And the function does not support negative values by design.

 Perhaps the inline documentation could be improved a bit.

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


More information about the wp-trac mailing list