Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93790 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22659 invoked from network); 4 Jun 2016 22:36:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2016 22:36:16 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.175 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.161.175 mail-yw0-f175.google.com Received: from [209.85.161.175] ([209.85.161.175:33829] helo=mail-yw0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/7E-25194-FD753575 for ; Sat, 04 Jun 2016 18:36:16 -0400 Received: by mail-yw0-f175.google.com with SMTP id c127so110948094ywb.1 for ; Sat, 04 Jun 2016 15:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=ETiRuYtJCdxaVqyKKM/OKXijieaIMDG+oyyX2XvYw4s=; b=WBiOYST1vJ3wfRB8wlJmE1ghRhr1vvyLdvHPezMOdCPduF5qIqaggoIX0NTnvDuuUx eM0p1ZCWrcjlLnFBG8yLkN+Mfs/LSSrsZSLbOQZc7Cg1YjN5UDEzjRe9ZDoqJsaqz/OG h7nwGJhjcaGvcHQMSt2VcxI1PQLj9aLxEc4wMAZsuDnf64Plefvp8jCVPDg6VIPzeIq1 Gze1fku92vmcYmV7NUwBRjzI+QVs+0fXAWs2UfDqLes8F16xqctRkI8YpJ42LiN1BeWW MAbg5IlLnTiCaz7gIWqLaQ9quQlrR+fYnsP3KKrgjPKQDtq3Eapzv/HNzdHw70bP/YbQ 8COA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ETiRuYtJCdxaVqyKKM/OKXijieaIMDG+oyyX2XvYw4s=; b=HLafd546JCNXMj/ESYGsVzNGuuwUlmONmheHGvhtoPhaNzgMsTfsTdeeVonqOFy3pv jkTTVwxYXzzgmUWVAqQ3RdCdZMFtipgB2it8CtHi1K4R1x2CQYE1LouECvBRRwp+MTF4 cTEtGCuQuzvcNPyf1kUlHZsGDjxKrqffiP8fJ7t5+sMr+LKzNXVfRtDVuctpAfdD+QL6 VrVfbLrrP9GlH9teFAH6N3XwIwLrbq1yaS/5Hk0BsAegL+sOkj7aKWe3upRl4ky1cVbZ s0upCDVjDy3zDscAwqHgWHj0vaDgWWlNhvXoifnMl8CUHJwBB490FLeYpap0m4oUg866 aAhw== X-Gm-Message-State: ALyK8tIIiehIyHSYxbzCbMeW4P/Neh9JfHS+7IiJKXVGlla9YR6uzsy2fdNuFUbCAv/8og== X-Received: by 10.129.162.141 with SMTP id z135mr6990110ywg.50.1465079773205; Sat, 04 Jun 2016 15:36:13 -0700 (PDT) Received: from stas-air.attlocal.net (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id i129sm7351302ywd.35.2016.06.04.15.36.12 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 04 Jun 2016 15:36:12 -0700 (PDT) To: Rasmus Schultz References: <94009625-535b-d937-21b6-b454f942a82d@gmail.com> Cc: Sara Golemon , PHP internals Message-ID: Date: Sat, 4 Jun 2016 15:36:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof From: smalyshev@gmail.com (Stanislav Malyshev) 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