note 129297 added to function.uniqid
| From: | theking2(at)king.ma | Date: | Sat, 02 Mar 2024 15:12:56 +0000 |
| Subject: | note 129297 added to function.uniqid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221226@lists.php.net to get a copy of this message | ||
Not sure why this function wasn't deprecated.
Modern users use this instead:
<?php
function uniqueId( ?int $size=48 ) : string {
return base64_encode( random_bytes($size) );
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.131 (proxied: 83.97.87.43)
----
Manual Page -- https://php.net/manual/en/function.uniqid.php
Edit -- https://main.php.net/note/edit/129297
Del: integrated -- https://main.php.net/note/delete/129297/integrated
Del: useless -- https://main.php.net/note/delete/129297/useless
Del: bad code -- https://main.php.net/note/delete/129297/bad+code
Del: spam -- https://main.php.net/note/delete/129297/spam
Del: non-english -- https://main.php.net/note/delete/129297/non-english
Del: in docs -- https://main.php.net/note/delete/129297/in+docs
Del: other reasons-- https://main.php.net/note/delete/129297
Reject -- https://main.php.net/note/reject/129297
Search -- https://main.php.net/manage/user-notes.php