Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95647 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57710 invoked from network); 5 Sep 2016 14:31:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 14:31:18 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.50 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.218.50 mail-oi0-f50.google.com Received: from [209.85.218.50] ([209.85.218.50:34647] helo=mail-oi0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/FF-45301-3B18DC75 for ; Mon, 05 Sep 2016 10:31:16 -0400 Received: by mail-oi0-f50.google.com with SMTP id m11so120927320oif.1 for ; Mon, 05 Sep 2016 07:31:15 -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=lgTX+jtgqMrTRr9YkyFF1rlaPdwem92tA0HTJs/SxHc=; b=SFqh/Hx53GXjkhQZuVwscsVJTdeVr9wVFzvrsdetby/6iKY++/mq8iAk8ewKLCh9Y5 L2t1cL76Pt3mRRpEfORdS+gxQEogYfKvqUI0MB/Ve2qB1U4Gap2NBqzRr6nRroWhpItq CMnxPkzaC87spzWmXr7GRP7B6XrZh6IlyIOYXvP2PnvPMO0OrAAOnefTP2HJOU9v934I wUO0d02P2mzgZr3iWEnuX3MvJRdFSO34kvVa+h6/VrB0k8pq0SkQYBAoPvh7fp8UkSSg EeQhGxZ2iXTg+BaYjg1IDVQGN787YZ3gqHY7hbXhMW9/MWJWSaFGWTcGYobFMCIxelMx rMVw== 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=lgTX+jtgqMrTRr9YkyFF1rlaPdwem92tA0HTJs/SxHc=; b=b4unTF2cU+KR+/hvuGA86ljO5S5hT5cpsbVXu1rgd184+7p1pQH6CIpoPNQYghi0v4 BJfRCR6qHow53QI+Yp1bBGkKZc3SpKiUpH46lwJkn4bY1rXyajUcCyIULkcjz0mdhmZI vaSuqS2sLd1+MkCFULyYQDuJVhevgRc3RF36jaPfy/CLVMs+MbwSxiswuT/Nrb6d4FkM 49k+ospNkQJj1eIbEf56XQlTX1EZG3SDI49VW8x/gzAUmnGcAkA+QMMVyecUk+w2rdp0 YS+Oao8+4iplaZ7EORxhntGXA2+Q9t/NDBshaHTxSm43a6VGncMaPc3YxHfQh9FvqGtX PT0w== X-Gm-Message-State: AE9vXwMa4g+u+cNxpPR1T3m0Nmw2KXN7QMOYpA4LNeqjRvPl7PU46HuNSSBZ2QBXjzLtAoS/pTVFTaNqI9Uf/A== X-Received: by 10.202.84.195 with SMTP id i186mr29472484oib.200.1473085873087; Mon, 05 Sep 2016 07:31:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.51.85 with HTTP; Mon, 5 Sep 2016 07:31:11 -0700 (PDT) Received: by 10.202.51.85 with HTTP; Mon, 5 Sep 2016 07:31:11 -0700 (PDT) In-Reply-To: References: Date: Mon, 5 Sep 2016 21:31:11 +0700 Message-ID: To: Julien Pauli Cc: Nicolas Grekas , PHP internals Content-Type: multipart/alternative; boundary=001a113de352306ea6053bc388b7 Subject: Re: [PHP-DEV] Missing reflection info about strict types? From: pierre.php@gmail.com (Pierre Joye) --001a113de352306ea6053bc388b7 Content-Type: text/plain; charset=UTF-8 Hi, On Sep 5, 2016 8:53 PM, "Julien Pauli" wrote: > > On Mon, Sep 5, 2016 at 3:19 PM, Julien Pauli wrote: > > On Mon, Sep 5, 2016 at 2:44 PM, Nicolas Grekas wrote: > >> Thanks for trying Julien > >> > >>> I guess what you miss for what you want to do, is to detect if strict > >>> types are activated into the current scope, at runtime. > >> > >> > >> From the inside, the author of the code knows if they added the declare or > >> not. > >> I'd need to know from the outside, before concatenating it, if some file has > >> strict types. > >> This could be exposed on the reflection, since a function/method/class could > >> have a flag that tells if it has been compiled with strict types enabled or > >> not. > >> The current alternative is to parse the source to check if it starts with > >> the declare directive (but not trivial because of non semantic tokens). > >> > > > > Then you need reflection. > > > > I just added ReflectionClass:isStrictlyTyped() and > > ReflectionFunction::isStrictlyTyped() to my patch > > > > https://github.com/jpauli/php-src/tree/is_strict_types > > Any souls to +1 the reflection patch ? I am not sure about it. Given the concept being strict type it should not matter, at all (given the reasons well explained here and in the RFC). Or do I miss something? --001a113de352306ea6053bc388b7--