Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110073 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60930 invoked from network); 7 May 2020 17:39:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 May 2020 17:39:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1A919180510 for ; Thu, 7 May 2020 09:14:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 7 May 2020 09:14:43 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id y24so7513093wma.4 for ; Thu, 07 May 2020 09:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wf0f6lSXbgyp1y7uc3XTPBNdgxf7qoWuyLq/QOKrVFo=; b=HspQ5fCmSMHBpbZkASPZw2Wnfqe9wr56rA7LR6YhdZjH6H6JGjVF/6/SrQDl+FY2Ig helYmV6+ZhTAkQd6354zwNz+zCi3nKSK+OfUGXalt7GuUw0dMPXDHtSf3Aimv6dR+mZJ 2QRLSwXMhDeLSfl/HG+o+icfmfwgzy4Tv0IN4i4x55UL817cq6cipVKCnla2XqdehJ46 Pb+9iq/aCYveXJyuZ0rRVwNJ8It0Q0Lei8p9Kb9jBgFhFNRppXLSX345MxAzEXuqvd7D OA77jkFHCEINx6tZ4AXO5TFhmk1kCPHsj8zdszETYGWccu6Yna2QZVs2I+q/vCNtyqHH A1Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wf0f6lSXbgyp1y7uc3XTPBNdgxf7qoWuyLq/QOKrVFo=; b=ml7RLMXAKlBzgvlTl3mpBOc8H8TqOimIgcMa9rQf15usNotuHLj+g7PdnOkxgOMZ0b xcz4oq29HKgoAFS4310v0y9y9LSbzQXaAt0eHycQfz4x2J+q9ZscD37d5Nwo1Kb69JSx NBd5gBFvS3tVbY6NVM0PwhGbDTlLjp1lJpuHHeb2IZx1LZgwNIancCKfJ55pdlY0e/ye GADsZ8Qz7gOxABadY3Tyd8qIRhKqPGENKuv4t7qGXTUSWRy4xRRX6Jn9WDb+TnnclMJ9 mggroWchyP6uRRpnwjzN82JAUOhwF/TSYSZQpB2kg0eBcm7QTQyIGGVYdbw4AkbQtb/t fHCw== X-Gm-Message-State: AGi0PuYZSU0WpDGVD3ubhHd9t0Pe0wc1df9xM9gB8Xw73FsoPRP59THa D8v0S+hxndrR4f4BYNTmqZBLPn4gEHBqTrSSH2s= X-Google-Smtp-Source: APiQypIj8X8iw6PsqU2Mn1iY7tItShv0SB+zWeJxeE4lYvdxmyrxjdYhD7IHseswmAyvhfjoO5m9rFzXC74Wq/OGnd0= X-Received: by 2002:a1c:ed0b:: with SMTP id l11mr12022214wmh.31.1588868081558; Thu, 07 May 2020 09:14:41 -0700 (PDT) MIME-Version: 1.0 References: <9e3b1604-8d0a-9db4-aab6-e5f2198252f4@allenjb.me.uk> <3a2924d2-31b9-fee5-5548-49c889eca2f4@heigl.org> <456FDEDB-770E-41A0-9B15-46768232F2C2@benramsey.com> In-Reply-To: <456FDEDB-770E-41A0-9B15-46768232F2C2@benramsey.com> Date: Thu, 7 May 2020 18:14:14 +0200 Message-ID: To: Ben Ramsey Cc: Dan Ackroyd , Rowan Tommins , PHP internals Content-Type: multipart/alternative; boundary="00000000000098aacd05a5112df3" Subject: Re: [PHP-DEV] Deprecating uniqid() From: arvids.godjuks@gmail.com (Arvids Godjuks) --00000000000098aacd05a5112df3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Ben, On Thu, 7 May 2020 at 17:29, Ben Ramsey wrote: > > On May 7, 2020, at 09:33, Dan Ackroyd wrote: > > *snip* > > I=E2=80=99m done waxing philosophical, so what I can say about `uniqid()`= ? > > This is one of those functions I think (without doing the research) is > used a lot in CLI scripts and tooling. As a result, it may be impossible = to > do good research on this, since these scripts are probably not available = in > public repositories. Additionally, when I write scripts like this, I don= =E2=80=99t > reach out for Composer packages, since I don=E2=80=99t need the overhead = of a > full-blown project or library, and I doubt others do, as well. This means > allowing userland to fill the void left by the removal of `uniqid()` may > not be a good option. > I think we should err on the side of BC with `uniqid()`. While the manual > says it=E2=80=99s been in the language since PHP 4, the research I did in= the > =E2=80=9Cmuseum=E2=80=9D shows that it=E2=80=99s been in PHP since 2.0b9 = (see the Changelog in the > tarball for 2.0b10[6]). > > Is there any way we can improve this function without deprecating/removin= g > it? > Exactly my case - a background processing script that lives in CLI without any 3rd party libraries parsing a CSV just doing some SQL queries inserting data and using uniqid(more_entropy=3Dtrue) (and removing the dot from it's output). In my opinion, this is one of those somewhat simple and widely used functions that do not need constant updating and just making it's random part more robust and up to date will be sufficient for it's use. Yes, we can depreciate the uniqid and replace it with a new function that is much better at its job to facilitate proper migration. But removing a tool like this from the core does seem somewhat on the extreme end of things. --=20 Arv=C4=ABds Godjuks +371 26 851 664 arvids.godjuks@gmail.com Skype: psihius Telegram: @psihius https://t.me/psihius --00000000000098aacd05a5112df3--