2016-09-05 15:52 GMT+02:00 Julien Pauli <jpa...@php.net>:

> On Mon, Sep 5, 2016 at 3:19 PM, Julien Pauli <jpa...@php.net> wrote:
> > On Mon, Sep 5, 2016 at 2:44 PM, Nicolas Grekas <nicolas.gre...@gmail.com>
> 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
> <https://github.com/jpauli/php-src/tree/is_strict_types>


>
> *Julien*


> *--*

*PHP Internals - PHP Runtime Development Mailing List*

*To unsubscribe, visit: http://www.php.net/unsub.php
> <http://www.php.net/unsub.php>*

_types <https://github.com/jpauli/php-src/tree/is_strict_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

Reply via email to