Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95643 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40858 invoked from network); 5 Sep 2016 13:20:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 13:20:03 -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.50 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wm0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:36411] helo=mail-wm0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/6E-45301-EF07DC75 for ; Mon, 05 Sep 2016 09:20:00 -0400 Received: by mail-wm0-f50.google.com with SMTP id b187so19532553wme.1 for ; Mon, 05 Sep 2016 06:19:58 -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=AOEdIPDI9mOs6tFPpbbvidPqppa362Wpz4mi6x9mjX4=; b=qGXGjYZ7RdGSvEKEaKmFhXQ1ADSlHmdmrcCqiXI3qUG2b9AFwvgTjyzpTFLUx6zDy8 cD3hTkS4U9htMZZ446H3fO4/YTWu9vUt5y7UmGATKp3UTME1WxCnXg0bHhoacpnRWWdC GSmLEEyAEzIg5jkqRVbv6+4/dDZziIZJ5CJLfHsGIkGfDHIGJq/i5yterYmjku8oY9eD oxt6GRCWV0Xj4cSr2MMdcQ7aqNz+jdcv9ZvrKdYI96hhCeia12ktSHYFCnbgKOov2iHW foQGTZK4MySs4z8bqaEYaOSwkPU6/HQ61Fi5P1L3zS8K7j6KSZ1KYdjrV6mddx5LUM9U advw== 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=AOEdIPDI9mOs6tFPpbbvidPqppa362Wpz4mi6x9mjX4=; b=jVKkvYYbLQZcbxEp2j5wH56nm4v2pvHMe6g/+fFg1xMmlgP7momLWebbZ39CyJ6olH 11qeW7pBXCrrP6IJig41rBan8fSSc8dhNC8Awuw6mmHgYqdcJAPjXyb87izeH/JAymlV zejBcMSYw/23zx6vPmQJU0jj3cdzH3bn4U8FdjtXjvYUtmAeRurUz42TKt6j14VgRPq8 4ohSBqGfMDbLdJg9Kw4NWXw5Y12j7S7SgPuumYUKSfgguGmvDZ5eM6sq6Xb2nmP3h0N8 t+Txs7tiUx2jzvtKmc9uB5tpSu5ltvGoiwFgopXQJSjShAWhapoldYA65qXk4cHiFtBa A9wA== X-Gm-Message-State: AE9vXwNv+b0uw550XwRU+n24HDNbrzcNQrce61cELepv9EpnuDFWuODLQqgyfSVbLiaEKqOpPmp2xwHjZSHUVw== X-Received: by 10.28.24.5 with SMTP id 5mr15849440wmy.6.1473081596069; Mon, 05 Sep 2016 06:19:56 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.194.45.4 with HTTP; Mon, 5 Sep 2016 06:19:15 -0700 (PDT) In-Reply-To: References: Date: Mon, 5 Sep 2016 15:19:15 +0200 X-Google-Sender-Auth: 3Rzw_RczRvEAU3rU0Ku1f15qlaQ 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 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 Julien.P