Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93811 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83240 invoked from network); 5 Jun 2016 11:50:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2016 11:50:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.213.41 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.213.41 mail-vk0-f41.google.com Received: from [209.85.213.41] ([209.85.213.41:34418] helo=mail-vk0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/F4-55579-02214575 for ; Sun, 05 Jun 2016 07:50:57 -0400 Received: by mail-vk0-f41.google.com with SMTP id e4so31295316vkb.1 for ; Sun, 05 Jun 2016 04:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xHx27OcoF5Q0e1LGAy9McKLpg3tWGP5fz1H6zD4lvkM=; b=GPpFnh69zNRf5eTFeacmXMp6GDcwl2ekKN7iJwWJ+tbleUDXO0BHPT0gf3sEJ7begY c9LJOEG3CcNOyq855T8NB6H8nYuVXCk3lWOnL6WE+5NSYP+Y747zCNF+Lq5CG0Y0Voqf wY9lFeJa0X3SyQvOW+4xt4y2P6inCD9XauOLsUkmFzrF48GDwKzNgQBmOuGw8BuJ9YwJ 828CCznoPkNpSrOdzw1wata29uV2bbTv9MB5z4YOmzvi305gqZkpUZzRKBZoDY1y8uPE satBRpXPPsf4Kn+Ks+ZPmEV/Cbe0CqAa6MUPx2bnBR/WeEdKPAj3yUtelyR8GxKh3Ufq REhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xHx27OcoF5Q0e1LGAy9McKLpg3tWGP5fz1H6zD4lvkM=; b=YN9xo53QHC5UIrhcxykkBYB0uiumjusGwdqX0ZTbLjurUFaq24J3oeJQJt7M2hyaUu QsUruQ0OrdjTCGZk/gM86hkwi0zunjA6hTMAY/yzdRH4wH9jUm5FdHIdAM0fDnwg/Jct U/op2TkbMcng01sIqbpeW+0CkOVgmjjR7YwKB/HMd9BJHRlbW9tzWHwNoX0k6gJ6LEvp U9EjAERYjfILZI0jX6UW9HgOr1pGLZcBk6NsqURiDVFU5+dxSIbNHwlGudwXaNdkdF9v sBNXIbMwgBEI6XI1WyOtETl/x01kV85sKj6BVC6Sv4FpC4Ejj84ANH5vO2HQI67Jb7X4 iAXA== X-Gm-Message-State: ALyK8tJdaG6NIDS6MqTdkVvuM2f2+ctrEwYrxzpR+rMX73+KWlY7BLlGzodieG+LGHdh4UTxtfOqdsZuo8hTKg== X-Received: by 10.159.54.207 with SMTP id p73mr5903362uap.35.1465127454045; Sun, 05 Jun 2016 04:50:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.76.200 with HTTP; Sun, 5 Jun 2016 04:50:53 -0700 (PDT) In-Reply-To: References: <94009625-535b-d937-21b6-b454f942a82d@gmail.com> Date: Sun, 5 Jun 2016 13:50:53 +0200 Message-ID: To: Stanislav Malyshev Cc: Sara Golemon , PHP internals Content-Type: multipart/alternative; boundary=94eb2c03d2c673116b053486917b Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof From: rasmus@mindplay.dk (Rasmus Schultz) --94eb2c03d2c673116b053486917b Content-Type: text/plain; charset=UTF-8 > So let's add more of it by having multiple functions that do exactly the same thing but name null and float differently. It's a point of view, that's all. You can choose your point of view - I choose the point of view where we replace a broken function with a function that does what developers would actually *expect*. You know what, all this rhetoric in favor of inconsistency, against a solution that has already been implemented? I don't know how to participate in this. On Sun, Jun 5, 2016 at 12:36 AM, Stanislav Malyshev wrote: > Hi! > > > The old function is actively causing confusion - the reported type-names > > aren't even inconsistent with scalar type-hints, and then you have to go > > and read the manual with some explanation about historical reasons why > > the function doesn't work like you'd expect. > > Why it should match scalar types? You can't use output of this function > in a scalar type in any way. > > > PHP is infamous for these surprise moments. > > So let's add more of it by having multiple functions that do exactly the > same thing but name null and float differently. > > > I think that gettype() should be deprecated in favor of a new function > > that actually makes sense. > > If you think people would want to edit gigabytes of existing code > because you want NULL to be lowercase, you are very seriously mistaken > about the order of priority of an average PHP developer. I am sure > 99.9999% of people care about all this pedantry infinitely less than > they care about their code keeping working and their development not be > impeded by things like having to read the manual each time to choose > which two of almost identical functions they need now and which of them > has null in which case. > > > I think that deprecating and fixing things is long-term less confusing > > than documenting your way around legacy functions that produce > > surprising and confusing results. > > I think constantly disrupting the language environment by pedantic > tweaks that add BC and cognitive load but do not actually enable > anything new, just move things around - is not only confusing, but > harmful for the whole ecosystem. > > And if "NULL" really confuses you to the point you have no idea what it > means - well, really, I don't know what to say. > > -- > Stas Malyshev > smalyshev@gmail.com > --94eb2c03d2c673116b053486917b--