Re: [PHP-DEV] Missing reflection info about strict types?

2016-12-05 Thread Nicolas Grekas
Hello, back on this topic: 2016-09-08 6:51 GMT+02:00 Rasmus Lerdorf : > On Sep 5, 2016, at 13:13, Nicolas Grekas wrote: > > > > It's not specifically me but Symfony's ClassCollectionLoader::load() > > method, which generates a single file with common classes inlined for > > faster bootstrapping

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-07 Thread Rasmus Lerdorf
On Sep 5, 2016, at 13:13, Nicolas Grekas wrote: > > It's not specifically me but Symfony's ClassCollectionLoader::load() > method, which generates a single file with common classes inlined for > faster bootstrapping (the perf gain is objectively measurable). I have a hard time believing concaten

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-07 Thread Lars Strojny
> On 07 Sep 2016, at 10:13, Leigh wrote: > > On Mon, 5 Sep 2016 at 10:39 Nicolas Grekas wrote: [...] > As an aside, would you guys like to see a strict types indicator in debug > backtraces? I wrote a small patch for it back during development of 7, and > then forgot about it. > > https://gith

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-07 Thread Michael Morris
On Wed, Sep 7, 2016 at 4:13 AM, Leigh wrote: > > > As an aside, would you guys like to see a strict types indicator in debug > backtraces? I wrote a small patch for it back during development of 7, and > then forgot about it. > > https://github.com/lt/php-src/commit/ac1171a81df814ad0042ef5989010b

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-07 Thread Leigh
On Mon, 5 Sep 2016 at 10:39 Nicolas Grekas wrote: > Hello, > > It looks like we miss a way to check by reflection if a function/method has > strict types enabled or not. > > We'd need to do this in Symfony to generate a file with concatenated > classes, but split "declare_strict=1" classes out so

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Nikita Popov
On Mon, Sep 5, 2016 at 11:09 PM, Andrea Faulds wrote: > Hi Nikita, > > Nikita Popov wrote: > >> As I see it, the issue here is really not how to figure out whether a file >> uses strict_types, the issue is how you mix strict_types=1 and >> strict_types=0 code in a single file. >> > > This is also

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Andrea Faulds
Hi Nikita, Nikita Popov wrote: As I see it, the issue here is really not how to figure out whether a file uses strict_types, the issue is how you mix strict_types=1 and strict_types=0 code in a single file. This is also my assessment. Back when this feature was introduced, we decided not to

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Fleshgrinder
On 9/5/2016 10:38 PM, Nikita Popov wrote: > Stripping strict_types declaration will change the behavior of the code > declared *within those files* (not the code calling that code). The > behavior should not change in the merge process. > > As I see it, the issue here is really not how to figure o

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Nikita Popov
On Mon, Sep 5, 2016 at 10:30 PM, Davey Shafik wrote: > On Mon, Sep 5, 2016 at 1:13 PM, Nicolas Grekas > wrote: > > > > Why do you concatenate these files in the first place? > > > > > > > > > > It's not specifically me but Symfony's ClassCollectionLoader::load() > > method, which generates a sin

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Davey Shafik
On Mon, Sep 5, 2016 at 1:13 PM, Nicolas Grekas wrote: > > Why do you concatenate these files in the first place? > > > > > > It's not specifically me but Symfony's ClassCollectionLoader::load() > method, which generates a single file with common classes inlined for > faster bootstrapping (the per

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Nicolas Grekas
> Why do you concatenate these files in the first place? > > It's not specifically me but Symfony's ClassCollectionLoader::load() method, which generates a single file with common classes inlined for faster bootstrapping (the perf gain is objectively measurable). You give this method a list of cl

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Julien Pauli
On Mon, Sep 5, 2016 at 7:38 PM, Andrea Faulds wrote: > Hi, > > 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

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Niklas Keller
2016-09-05 17:25 GMT+02:00 Nicolas Grekas : > > > > being strict type it should not matter, at all > > > > It doesn't, except when trying to concatenate several source files into a > single bigger one. > Then we're stuck because declare(strict_type=0/1) is specifically *not* > allowed in the middl

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Andrea Faulds
Hi, 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

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Nicolas Grekas
> > being strict type it should not matter, at all > It doesn't, except when trying to concatenate several source files into a single bigger one. Then we're stuck because declare(strict_type=0/1) is specifically *not* allowed in the middle of a file, and *not* allowed to use the block syntax (decl

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Michael Morris
On Mon, Sep 5, 2016 at 5:49 AM, Davey Shafik wrote: > > > On Sep 5, 2016, at 02:38, Nicolas Grekas > wrote: > > > > Hello, > > > > It looks like we miss a way to check by reflection if a function/method > has > > strict types enabled or not. > > > > We'd need to do this in Symfony to generate a

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Pierre Joye
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 acti

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Niklas Keller
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 int

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread 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 ins

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread 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 >

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Nicolas Grekas
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, i

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Julien Pauli
On Mon, Sep 5, 2016 at 11:38 AM, Nicolas Grekas wrote: > Hello, > > It looks like we miss a way to check by reflection if a function/method has > strict types enabled or not. > > We'd need to do this in Symfony to generate a file with concatenated > classes, but split "declare_strict=1" classes ou

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Davey Shafik
> On Sep 5, 2016, at 02:38, Nicolas Grekas wrote: > > Hello, > > It looks like we miss a way to check by reflection if a function/method has > strict types enabled or not. > > We'd need to do this in Symfony to generate a file with concatenated > classes, but split "declare_strict=1" classes o

Re: [PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Niklas Keller
2016-09-05 11:38 GMT+02:00 Nicolas Grekas : > Hello, > > It looks like we miss a way to check by reflection if a function/method has > strict types enabled or not. > This isn't bound to functions / methods and can't be reflected. > We'd need to do this in Symfony to generate a file with concate

[PHP-DEV] Missing reflection info about strict types?

2016-09-05 Thread Nicolas Grekas
Hello, It looks like we miss a way to check by reflection if a function/method has strict types enabled or not. We'd need to do this in Symfony to generate a file with concatenated classes, but split "declare_strict=1" classes out so that they don't break (because there is no way to create a sing