Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111064 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22730 invoked from network); 17 Jul 2020 10:37:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jul 2020 10:37:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 04B741804DA for ; Fri, 17 Jul 2020 02:30:28 -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-Virus: No X-Envelope-From: Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 ; Fri, 17 Jul 2020 02:30:27 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id k15so5665076lfc.4 for ; Fri, 17 Jul 2020 02:30:27 -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=tF/XN8K7QLXNIDHiPgraP8rdyQD0O06LQVDs0jwlTE4=; b=vXECYpfqHOojYxGgBxs0S5hzBCwcKrwJGaG4caV8gEzsnuGPRBeD822Rlhd2P11Vfz CeNinr3UM/XmGI37T9qOibUpgKJkcSsdPQiYQ7znbktoKHzpKa5IWOQ9kXvpehs9frAE RuYqmvhCOjM9LmfU1OWNAbPGTnHuohPpLmOkyOos2GgQ7ivB8UEPpbz1ZCeOQQxl0aPs HngJrcqxOXcfY+uHvga4bSJZcvUPk7vwjN+RkHP6G5I1T/s0gkhV1uj7VVDlqQXAWgbl beMT2naIQWpdgbG6bYgGB1OmBBjUlFpiIB31rVU7Y8q9qiDPxir37s9ai7nqNokVG6f8 3WAA== 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=tF/XN8K7QLXNIDHiPgraP8rdyQD0O06LQVDs0jwlTE4=; b=dpNAmQIFRmwooR+968WaRexmvDJE1a7xcg+trioDvNXNt0JlsoUcb1CWAt8R1ScibC RU4a1qOtcNA2QGawxcHVX6xlCIhfELeM7gBlis8/sCUull/En5hi3X/cGVJHaetEHgW5 c8vZyjMQ2RU3SXNPWC1258WptlfXFMD/JgEQDPFTkNWZXwi+j4zcuLkctzBhOVidn4L1 BhMN+3FGaBJlpnGmqj4umdbOGYaYq8wLIK70/80WaUUm9KFjGLFxZbx/AzJOgZ8/zHRp 1OHiuumas1DZRbz+i7i2S5llHbwjQF8C+wO/3D6bf4tKZ7laHdnXzhEUPUQjIvyWbKKJ aUww== X-Gm-Message-State: AOAM533D15YmXSaRH04/7JyFGAjSX6QSdTzhDCbaej4LJtJlzBlK4IpL QmGqe8j1SkRfkUjgn68w0e+4XbxOx6S/K/45fLw= X-Google-Smtp-Source: ABdhPJxvA32IBufFVxG1kc5H7T2VX7i5eft4F85UOr5BcJXANfBt3CBABhrfvVbm2y08dn+8tZp+wunEkrjzn1QC6nI= X-Received: by 2002:a19:2388:: with SMTP id j130mr3618850lfj.190.1594978225860; Fri, 17 Jul 2020 02:30:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jul 2020 11:30:09 +0200 Message-ID: To: Bob Weinand Cc: "G. P. B." , PHP internals Content-Type: multipart/alternative; boundary="00000000000093b56305aa9fce3a" Subject: Re: [PHP-DEV] [RFC] [VOTE] Saner numeric strings From: nikita.ppv@gmail.com (Nikita Popov) --00000000000093b56305aa9fce3a Content-Type: text/plain; charset="UTF-8" On Fri, Jul 17, 2020 at 11:27 AM Bob Weinand wrote: > Hey George, > > while I agree with your RFC in general, changing the autocast behavior of > the empty string is not acceptable for me. > > Empty strings often are the output of non-existing things, like default > value of a text field in a DB, when reading files not filled with inputs > yet etc. It should expose a similar behaviour to all the other falsy > values, i.e. null, false, ... > The current side effects can be held in mind "ah this won't break if the > input is unexpectedly not present, should be safe" while writing code, but > finding places where that sort of assumption was made is next to impossible. > This should be a major step backwards from the forgiveness of PHP - > especially in cases where "shouldn't happen, but the behaviour is nearly > always what I expect, and logging will allow me to improve it". > I do not want to break everything in production because something happens > to return an empty string. > > I'm aware that it is different from the TypeError behavior of *userland* > functions (internal functions do only emit a warning). But internal > functions are the important foundation here. This is also internal, the > number conversions. > > Hence I'm voting no on this. > Can you give a code example for an undesirable behavior change? I don't think this proposal changes anything about the handling of empty strings. Empty strings are already considered non-numeric, and as such already result in TypeErrors (e.g. https://3v4l.org/WVfeg). Nikita > > Am 16.07.2020 um 16:18 schrieb G. P. B. : > > > > Hello internals, > > > > I've opened voting for the Saner Numeric strings RFC: > > https://wiki.php.net/rfc/saner-numeric-strings > > > > This will last 2 weeks until the 30th of July > > > > Best regards > > > > George P. Banyard > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --00000000000093b56305aa9fce3a--