Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54550 invoked from network); 5 Sep 2016 14:19:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 14:19:53 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.219 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.219 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.219] ([81.169.146.219:17461] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/9F-45301-60F7DC75 for ; Mon, 05 Sep 2016 10:19:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1473085187; l=6312; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=yCDrQ9NBlW1b6afm0xzwh0/aef58JaYdZa3Et3c/bOg=; b=YED8ZoH6IZrHXMGiv7RW9VABG6rSS80uE4k5BneBrqgzHoAWsJ8QSEoW3fWZQCgzQGn 8HmcUkRL7pHyZ3pUjofOCNcAvdsGjZ3WPVlGopCtOYbeAavJS6D5Op/PQpcfwLkKFNgcJ vsV42aw+aq5HbrMIG9Z005xMarqCrhHqPzc= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3E6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f42.google.com ([74.125.82.42]) by smtp.strato.de (RZmta 38.13 AUTH) with ESMTPSA id j0ac57s85EJlHqG (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Mon, 5 Sep 2016 16:19:47 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id w12so44160102wmf.0 for ; Mon, 05 Sep 2016 07:19:47 -0700 (PDT) X-Gm-Message-State: AE9vXwM1YFo+rWJbNRRVEdKwqNx0sQMViPHnP3KKzXNeRYaTBmind8sfzwhbIisw7O3ohK/Ei/IrQ94/xkyOrw== X-Received: by 10.194.236.68 with SMTP id us4mr30521727wjc.12.1473085187160; Mon, 05 Sep 2016 07:19:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.180.7 with HTTP; Mon, 5 Sep 2016 07:19:46 -0700 (PDT) In-Reply-To: References: Date: Mon, 5 Sep 2016 16:19:46 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Julien Pauli Cc: Nicolas Grekas , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e01493f5e4e143e053bc35ff8 Subject: Re: [PHP-DEV] Missing reflection info about strict types? From: me@kelunik.com (Niklas Keller) --089e01493f5e4e143e053bc35ff8 Content-Type: text/plain; charset=UTF-8 2016-09-05 15:52 GMT+02:00 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 > > > *Julien* > *--* *PHP Internals - PHP Runtime Development Mailing List* *To unsubscribe, visit: http://www.php.net/unsub.php > * _types > > Any souls to +1 the reflection patch ? ReflectionFunction::isStrictlyTyped doesn't make sense. As mentioned already, this doesn't depend on the function declaration but on the CALLER instead. Regards, Niklas --089e01493f5e4e143e053bc35ff8--