Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112915 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14116 invoked from network); 17 Jan 2021 17:23:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jan 2021 17:23:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CFC51180538 for ; Sun, 17 Jan 2021 09:02:58 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 ; Sun, 17 Jan 2021 09:02:58 -0800 (PST) Received: by mail-wr1-f45.google.com with SMTP id 7so6982879wrz.0 for ; Sun, 17 Jan 2021 09:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=TtIP9bPCU+4gZKRAfgmMEWjAZw646JwtEgmmm3XNKyU=; b=qzuWMlsqbh9qyCdN+3ok72RqiXljmwpTgsb0p190AXxNS5bI3SPZgII9UE9ctkj+qG sFUNUCZwl+zV5UtOoxw3OpVSv3gzfEGzPXeujKgPf0rrf1dILdyi+YQXDlFNDZ9otRlz 9Lqe5kvQ3yx+T+JJF81rjwC0cYkVPZTb9KyswmbA5mIDP/tScOssSxSJQsEGX8D5ZlaE EjJ97RlOP8SW4od9tkOtT6GQg1CLMfm4FKtBqEEYTVGJaIDpBKoYUVqaWPKq97X4jblA G84xa2pkY1CBg401gY1KA+xwpfUYkC2uc5Mo/Yel9s/bCe+5alrO/2cm3HesXg6VHRso jB2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=TtIP9bPCU+4gZKRAfgmMEWjAZw646JwtEgmmm3XNKyU=; b=Y+CgESgSnOX6/QJIrJmoAH2VXPXj2D8nBYl95pUdwlgrJ72tt7CbJb61isTnlzh9nQ oYYKp9M8hbQD3/VBil6VJWLCXxAk/PRJePB/yA4Q11Lv3stEOAii8jCgDPmiaEd1LpbW a+dKeD9ziVmHmDRGR5sGhyMAQitqJNFc7adFyF1iEnUWzqZbK4r/MhTazEccy0WMworN CCJHri5BEPld1cNJ9WE4fgRxVx4vkP0aLu3DJ5TmCzuzdHp02OHGlsoVd/sZKtHh4Cmd Du6mnebtOlchA9PQL2XMx9qTxfl2H96ID7QksLxk7bLEKCwtoz7dLCYe9NnJDloF5qXj 507g== X-Gm-Message-State: AOAM5313v67T+nd8mMVG5/g3JHm8Yq1vpbNdVseZck8O/AfSKQCrOUAB P1t3DXy6rLRMeYP5m9p5JwIfuqfgWBg= X-Google-Smtp-Source: ABdhPJxowImHpwQMju9tByDhuAsXtvnaQMzuXp/9jzPLtJl2+/cgBx7aKcZfnk6dW1qjeqByGFPKwA== X-Received: by 2002:a5d:4e89:: with SMTP id e9mr22065029wru.201.1610902975370; Sun, 17 Jan 2021 09:02:55 -0800 (PST) Received: from [10.11.115.104] (136.227.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch. [178.197.227.136]) by smtp.gmail.com with ESMTPSA id l7sm16550832wmg.41.2021.01.17.09.02.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jan 2021 09:02:54 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-F6C31CEF-5622-4F37-8BD5-3EC0B6B4B1FE Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Date: Sun, 17 Jan 2021 18:02:53 +0100 Message-ID: <85650FC3-F510-4837-8D21-875288EC1EF1@gmail.com> References: Cc: internals@lists.php.net In-Reply-To: To: tyson andre X-Mailer: iPhone Mail (18C66) Subject: Re: [PHP-DEV] Proposal: Render floats differently from integers in print_r() From: claude.pache@gmail.com (Claude Pache) --Apple-Mail-F6C31CEF-5622-4F37-8BD5-3EC0B6B4B1FE Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Le 17 janv. 2021 =C3=A0 16:58, tyson andre a =C3= =A9crit : >=20 > =EF=BB=BFHi internals, >=20 > Currently, print_r() will print ints and floats in exactly the same way, d= espite the fact that they are different types > and floats may cause a TypeError (or be treated differently from integers,= e.g. avro encoding) when used where an integer is expected. > This is not documented in https://www.php.net/print_r This is the same behaviour as `print` (and as`echo`). Note also that there i= s also no distinction for `print`/`print_r` in rendering the string "1", the= integer 1, and the boolean`true`. I think that the original intention of `p= rint_r` was to have a =E2=80=9Crecursive=E2=80=9D version of `print`.=20 If some action is to be taken, I suggest to deprecate `print_r`. =E2=80=94Claude=20 --Apple-Mail-F6C31CEF-5622-4F37-8BD5-3EC0B6B4B1FE--