Strict types indicator in backtraces

php.internals

Leigh

9 years ago
Hi all, I've written a small patch to add a "strict_types" key to the backtrace information for functions. https://github.com/php/php-src/pull/2177 The idea here is to be able to see more easily whether a parameter may have had it's type changed or not during a trace. Thoughts and opinions? Cheers, Leigh.

Nikita Popov

9 years ago
On Wed, Oct 26, 2016 at 8:00 PM, Leigh <leight@gmail.com> wrote:
> Hi all, > > I've written a small patch to add a "strict_types" key to the backtrace > information for functions. > > https://github.com/php/php-src/pull/2177 > > The idea here is to be able to see more easily whether a parameter may have > had it's type changed or not during a trace. > > Thoughts and opinions? >
I'm not sure I understand what the intended use case here is. Can you maybe show an example of where this would be useful / how it would be used? Note that the parameter type may change even with strict_types (int->float). Further note that parameter values may change in the body of the function, so you don't have a guarantee that it's the original value in any case. Thanks, Nikita