Commit b247fb9
committed
uniqid: Tighten return type to non-falsy-string
This commit tightens the return type of the 'uniqid' function from
non-empty-string to non-falsy-string. The official documentation [1] of
the uniqid function says:
> With an empty prefix, the returned string will be 13 characters long.
If more_entropy is true, it will be 23 characters.
This implies that the returned string will be of length strlen(prefix) +
(more_entropy ? 23 : 13). In either case, it will be of at least length
13. But the only falsy strings are '0' and '' (both of length less than
13) [2]. Hence the return value will always be a non-falsy-string.
[1] https://www.php.net/manual/en/function.uniqid.php
[2] https://www.php.net/manual/en/language.types.boolean.php1 parent 8f78985 commit b247fb9
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11282 | 11282 | | |
11283 | 11283 | | |
11284 | 11284 | | |
11285 | | - | |
| 11285 | + | |
11286 | 11286 | | |
11287 | 11287 | | |
11288 | 11288 | | |
| |||
0 commit comments