Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94345 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2018 invoked from network); 30 Jun 2016 21:57:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2016 21:57:51 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.182 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.220.182 mail-qk0-f182.google.com Received: from [209.85.220.182] ([209.85.220.182:33833] helo=mail-qk0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/D7-14264-ED595775 for ; Thu, 30 Jun 2016 17:57:50 -0400 Received: by mail-qk0-f182.google.com with SMTP id t127so171787440qkf.1 for ; Thu, 30 Jun 2016 14:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dsh2IFDSt5JMec7BkDTBaUdUw9w9panVIUZrerL9DGE=; b=ZkRAqzHXM275tkQtbmk24ZAETtanSxu4N08B/PphwHZv1VN4ckaScqsUpWEP+rP8++ L5r66MJkJ/OZWLHRerLvwkoZ4LFYz9jXDDlnpBImfUFi9EGmRTDjHkG1aEnxvUeSIjHo zulaFtmr3eC2SKOa3x+fYf/UCKv88IrY4M2DMaJlJlvWxKY4l+wa/+wYdbdynxc9Mirr yaouWB5/GnBIDhP9JSQzgtVTiaQN47CijbCMU8HKrumRAhQmqgXZyJl9/NFkEO+AMnD0 ueu0sGwzWtzwkkdCV2io6MROZsah5xAuI7cQRnQU6Lx41achHBBCD2eA9s5sLXTebw66 L6Sg== 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=dsh2IFDSt5JMec7BkDTBaUdUw9w9panVIUZrerL9DGE=; b=gfSD2Zwd44KIGHK6OF4kQth0Vj9wMhUy1SleZvv5rWmNsuKgUCBuOBdsCmvs1UqPIZ OfYnt2bhQkboePbEk7GoGl+hT8K6TKNBK61R7l0uSfSG9oUOPPLx0Se8kpGsw5JmNgwp CGCn+WVPyFrYJlNIKuM3QlX5lfLBWyncNFJdD5MifaQKNv/BHT/3giVXpKeg5d4+V5rF 10rLvinth02+VPzMJYgwVvwOGrrCMPPD+nasYFvFv1WkoKeKZ1NJiVzggypM0aF9ANDW MZ8qybh4zfhSb7cMSc62QndmmiHYLmdSwaRUwvOBfD+MPKkt0TsZTJNFL5CpUT2JPQcC z2SQ== X-Gm-Message-State: ALyK8tK+ACychevfTbKB4QGk62JJhThcZ8qHyz5uGgf9ytpR6CgFOB1/USe4zdDXGzN9i1DJ6UiuY6iqMuPfeA== X-Received: by 10.13.241.67 with SMTP id a64mr7910816ywf.93.1467323868117; Thu, 30 Jun 2016 14:57:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.219.203 with HTTP; Thu, 30 Jun 2016 14:57:47 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 Jun 2016 23:57:47 +0200 Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary=94eb2c0356f8ee089e053685f5dd Subject: Re: [PHP-DEV] [RFC][Vote] ReflectionType Improvements From: nikita.ppv@gmail.com (Nikita Popov) --94eb2c0356f8ee089e053685f5dd Content-Type: text/plain; charset=UTF-8 On Thu, Jun 30, 2016 at 6:06 PM, Levi Morrison wrote: > The RFC for improving ReflectionType[1] is now in voting phase. The voting > window is June 30th through July 8th. I have not finished the patch but > I'll have it done before the end of voting. > > [1]: https://wiki.php.net/rfc/ReflectionTypeImprovements Replying on-list as multiple people asked: I'm voting against this RFC, because it introduced not only the ReflectionNamedType class (which is reasonable), but also the ReflectionClassType class (which is not). My main objection to ReflectionClassType is that it is autoloading dependent (*). Something like getReturnType() on a class type hint will either return a ReflectionClassType if the class can be loaded, or a ReflectionNamedType if it can't. I think this is confusing and I'm sure that this will lead to broken code: For example, people will try to use "$type instanceof ReflectionClassType" to check whether something is a class type hint, while the currently correct way, which works independently of class loading, is to check isBuiltin() instead. I don't think that most consumers of ReflectionType are interested in obtaining a ReflectionClass for the type hint anyway (which is the only functionality that ReflectionClassType provides), and if necessary this can be easily done in userland. There is no need to over-complicate the ReflectionType functionality in this manner, especially with the proposed semantics. Nikita --94eb2c0356f8ee089e053685f5dd--