Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48897 invoked from network); 5 Sep 2016 13:52:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 13:52:52 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wm0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:35574] helo=mail-wm0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/3F-45301-2B87DC75 for ; Mon, 05 Sep 2016 09:52:51 -0400 Received: by mail-wm0-f45.google.com with SMTP id w2so123338229wmd.0 for ; Mon, 05 Sep 2016 06:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=61HzqiZHgKui05WHcceaxh9rtOwy2KPdYRjtony2/jY=; b=cadiouFs6QonqHCyn7hMK0O50GOWxUcfil1MhF5J/C9tcFql0+iWcTtKXV0bs52+dP PzuLnIf+rekT9THW0FcOHY093pY8I8iLje3Qvxt+HrVrLwOlojSF4/qIZrtuxYwoUBIj d38/EPaJrNA+UV0v1rN5TMA4ZTQ1h7BH+HkOuSFO4eR1yCn8lG+1h8KzkIRvDny9lPsG U4UEK0apWlY1rd45SWtAmQsi91fpvlZAXsLFB802WNDQ3XUemLhwT9bdAEfkzge56hJ/ 5uddjjJ3D4lEkMNzOPijDkeyiByvcpdf8gjDA0ClAx+SQqj0088bf8DLVh/2yILy9l2r snjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=61HzqiZHgKui05WHcceaxh9rtOwy2KPdYRjtony2/jY=; b=GSlSjUPjKdrORwtY6LzcXwuh9btcKw24rjFvDt1i0Th4GAccqrkdsf5eIjmwhsWOKz wQFoDpxkToQkuiBDmNr3LAzUTIKG9Jtjcc1fD5hsOz8gNsh4tK3SjIFzsDMI0Dk9jVdC e0MkVi0C+ZwbqBJTsBgxxbgA9LLdEmta6YcEDek/MqAx6OwsBO3TszwHEbl2b4tktJG3 WUZ4LIjA/Cu830OdxES3r55ADUQlNmG4pmKc3uN9OhAGz9PnO+kXMcisxvfZh0txOwZC H0/KNz3kLWDsWfM7OCF3gbg0WmnigKd7X5EkvTjpbyZZnDS0vKdvEElsZyoeQIPozc+h OPVw== X-Gm-Message-State: AE9vXwO+RG4wmoBXvH5BElSRtWdKqcuSdR3o0KTp4iAKFPkTX+GZawGgECIBW61fP++dWjqEAWRlv7uuMYCspA== X-Received: by 10.28.39.133 with SMTP id n127mr15999121wmn.6.1473083567729; Mon, 05 Sep 2016 06:52:47 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.194.45.4 with HTTP; Mon, 5 Sep 2016 06:52:07 -0700 (PDT) In-Reply-To: References: Date: Mon, 5 Sep 2016 15:52:07 +0200 X-Google-Sender-Auth: 5ljfAfvGqj0jxYpZKb-Kg2C-OAo Message-ID: To: Nicolas Grekas Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Missing reflection info about strict types? From: jpauli@php.net (Julien Pauli) 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 ? Julien