Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93786 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14291 invoked from network); 4 Jun 2016 21:25:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2016 21:25:36 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.213.42 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.213.42 mail-vk0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:35874] helo=mail-vk0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/FC-25194-F4743575 for ; Sat, 04 Jun 2016 17:25:36 -0400 Received: by mail-vk0-f42.google.com with SMTP id c66so3082928vkb.3 for ; Sat, 04 Jun 2016 14:25:35 -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=8o44fnhUjSjyjZ90nj+TjmDAyA3Y+YJb4HcurM1VUK4=; b=ur4nleE2fl4/F5lJPmniKy0jeHKjaJWyMbjQq2TURL8nwaQ8YvyezyEMlsr+kZIjNZ alNByS8sc7GrV1+52WCWK7PQ1/rMVwlOPZVcgke9kJYy7hD1ANbZAC6Ix2sCKEwuAFoZ q9mhR4iPV7Ay03LrGgcKKVDyXjcwltBawRo3efTHyJtk6HdFm0EQPD898q0znwXZaSuj D3GXwlity0+foMP+tJvPoHE+69wDLg0ZR8hhgxhsTvsur1BtkNvQldDN/s6xrALOlS1c kOGgk1XwKNiMjymlfIlqIPamRMw9Nc5oxYYEVshjWxtF86SlosXdZUBJ4DE6m8abubD3 5vyA== 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=8o44fnhUjSjyjZ90nj+TjmDAyA3Y+YJb4HcurM1VUK4=; b=lrvj/a4i1hH+DyrM4eB3AfTDAbTEWXTtInB++d0Q/fQwLwTBpKtITY8BUwmVVCH06u bANMRSAl28JZv+hVY3iF2GK4hCoME6n8Qmf1X4Rl8D37V44yLYuT6LZtxeeDasaT5/Xs e601LoUTMJQIK7SvBqrpIuLA1B+AOUy2IoFPGXqW9LXvOez2SM4sMYL4EsVxTBP6BLbD WU9+IHAC0HuyYQ8YMMRuJWgQ9X9UjaJ2eORzIioM5XsRruWZJKE32IR0HI4XlWTCknBS eDyqfk0UYf4tEworHPVUfsBqWPmp1u2KGir6r7vrlL1VJwuKfxYRKCUjpHSGpEUoVn7F BaZw== X-Gm-Message-State: ALyK8tI0PQ50z6aQc8i+fqF7+Vb3tzSv4lYhIkitSK2ECtmDgul8aanh6oRb47+tzLGx1D3vCM/pDlTLq3wMQA== X-Received: by 10.31.10.82 with SMTP id 79mr4019355vkk.67.1465075532995; Sat, 04 Jun 2016 14:25:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.76.200 with HTTP; Sat, 4 Jun 2016 14:25:32 -0700 (PDT) In-Reply-To: <94009625-535b-d937-21b6-b454f942a82d@gmail.com> References: <94009625-535b-d937-21b6-b454f942a82d@gmail.com> Date: Sat, 4 Jun 2016 23:25:32 +0200 Message-ID: To: Stanislav Malyshev Cc: Sara Golemon , PHP internals Content-Type: multipart/alternative; boundary=001a11457d64b6f52a05347a7afc Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof From: rasmus@mindplay.dk (Rasmus Schultz) --001a11457d64b6f52a05347a7afc Content-Type: text/plain; charset=UTF-8 > I don't think we need a core function that almost exactly duplicates the working of existing function but with a slight tweak. I do not think it is a good idea to do such things, it only produces more confusion. I strongly disagree. 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. PHP is infamous for these surprise moments. I think that gettype() should be deprecated in favor of a new function that actually makes sense. 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. IMO this is a clear improvement which *removes* a source of confusion. On Sat, Jun 4, 2016 at 10:38 PM, Stanislav Malyshev wrote: > Hi! > > >> My number one issue with this PR is that it's all PHP code. There's > nothing > > in here that couldn't be done as a composer installable library > > > > It's a valid point, but not really a good argument against having it - > the > > same could after all be said about a lot of PHP functions. > > Many of those were introduced when we didn't have good ecosystem for > libraries, and whatever is baked into PHP binary is all you got to work > with. Not the case anymore. Many others were introduced because it was > hard to do it in PHP (no access to some internals, or slow, or required > things that code break between versions). Not the case here either. > > Also, there's a difference between core having 20 functions and adding > 21st that is doing something new, and core having 200 functions and > adding 201st that does exactly like one of the existing ones but > slightly different (slightly enough so you'd have to consult the manual > now to see why you used each of them in each context). > > -- > Stas Malyshev > smalyshev@gmail.com > --001a11457d64b6f52a05347a7afc--