Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Nikita Popov
On Sun, Aug 21, 2016 at 10:28 PM, Dan Ackroyd wrote: > On 21 August 2016 at 20:43, Marco Pivetta wrote: > > > > Sadly, it won't. Here's an example that shows the BC break in a more > > explicit way: > > > > function foo(Iterator $i = null) {} > > var_dump((string) (new ReflectionParameter('foo',

Re: [PHP-DEV] Re: [RFC][VOTE] Add validation functions to filter module

2016-08-21 Thread Yasuo Ohgaki
Hi Stas, On Sun, Aug 21, 2016 at 1:39 PM, Stanislav Malyshev wrote: > >> It's possible to design web pages/services to "unknown clients", but >> it's exceptional cases. > > No, it's not. Every service exposed to the internet is for unknown clients. Right and wrong. Every service exposed to the

Re: [PHP-DEV] Re: [RFC][VOTE] Add validation functions to filter module

2016-08-21 Thread Yasuo Ohgaki
Hi Lester, On Sat, Aug 20, 2016 at 6:21 PM, Lester Caine wrote: > On 20/08/16 08:30, Yasuo Ohgaki wrote: >> The input validation we are discussing is "Input/output rules between >> client and server". It decides what's valid/invalid. > > I think I'm getting two things confused and am mixing your

Re: [PHP-DEV] [RFC][DISCUSSION] Remove utf8_decode() and utf8_encode()

2016-08-21 Thread Yasuo Ohgaki
Hi all, On Sat, Aug 20, 2016 at 12:24 AM, Rowan Collins wrote: > On 19/08/2016 16:12, Pierre Joye wrote: >> >> I am against removing them, now or in 8.x. this is the kind of things that >> makes migrations painful. They are broken on some cases? Fix them maybe? > > > The thing that is broken abou

Re: [PHP-DEV] Class Constant Visibility BC Break

2016-08-21 Thread Dan Ackroyd
Hi Marc On 21 August 2016 at 21:57, Marc Bennewitz wrote: > > So for me this is a BC break So that we're clear about what we're discussing, please can you post some example code that: i) Works in PHP 7.0.x ii) Won't work in PHP 7.1.x cheers Dan -- PHP Internals - PHP Runtime Development Mail

[PHP-DEV] Class Constant Visibility BC Break

2016-08-21 Thread Marc Bennewitz
Hi, I encountered a problem of my library with the new class constant visibility functionality. The problem is that I'm using ReflectionClass::getConstants() to detect class constants but I'm only interested in public constants. Before class constants were public by definition but now it c

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Dan Ackroyd
On 21 August 2016 at 20:43, Marco Pivetta wrote: > > Sadly, it won't. Here's an example that shows the BC break in a more > explicit way: > > function foo(Iterator $i = null) {} > var_dump((string) (new ReflectionParameter('foo', 0))->getType()); > > This reports `Iterator` for PHP 7.0.x, `?\Itera

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Levi Morrison
On Sun, Aug 21, 2016 at 1:52 PM, Marco Pivetta wrote: > I still want to see code that outweights these commonly used open-source > tools before you grab that argument again. > > As also said by Dan: new features => adaptation required. > > Supporting `?` in your own home-grown internal code-gener

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Marco Pivetta
I still want to see code that outweights these commonly used open-source tools before you grab that argument again. As also said by Dan: new features => adaptation required. Supporting `?` in your own home-grown internal code-generator is something you can do as part of a 7.1 migration path, exac

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Levi Morrison
> > The issue here is around changes that affect old features (__toString), > where the behavior changes depending on whether a parameter is defaulted or > not (also a previously existing feature) > Which has existed for only one release. This is a small BC break and is intended. We previously had

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Marco Pivetta
Hi Dan, On Sun, Aug 21, 2016 at 8:55 PM, Dan Ackroyd wrote: > On 21 August 2016 at 17:01, Marco Pivetta wrote: > > Yes, but the __toString API is used for codegen, and current code > > generators don't expect a `?` to appear there. > > And they will continue to not have a `?` when reflecting PH

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Dan Ackroyd
On 21 August 2016 at 17:01, Marco Pivetta wrote: > Yes, but the __toString API is used for codegen, and current code > generators don't expect a `?` to appear there. And they will continue to not have a `?` when reflecting PHP 7.0 code. It is only when reflecting 7.1 code, that has a different s

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Marco Pivetta
Yes, but the __toString API is used for codegen, and current code generators don't expect a `?` to appear there. How many engineers and failing unit tests does it take to explain a BC break? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sun, Aug 21, 2016 at 6:00 PM,

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Levi Morrison
> > This is the ultimate point: if we don't prepend the question mark it will >> break code. >> > > This is the impedence here: `ReflectionType` is a *REFLECTION*, not a code > generator. Don't think of `ReflectionType#__toString()` as a way to > generate code: it is merely a string representation

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Marco Pivetta
On Sun, Aug 21, 2016 at 5:46 PM, Levi Morrison wrote: > > > On Sun, Aug 21, 2016 at 9:42 AM, Marco Pivetta wrote: > >> Including the question mark still breaks code-gen based on simple >> nullable types. PHP 7.0.x-compliant code will do following: >> >> - reflect function foo(Bar $bar = null) {

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Levi Morrison
On Sun, Aug 21, 2016 at 9:42 AM, Marco Pivetta wrote: > Including the question mark still breaks code-gen based on simple nullable > types. PHP 7.0.x-compliant code will do following: > > - reflect function foo(Bar $bar = null) {} > - cast ReflectionType to string > - crash (unrecognized `?` s

Re: [PHP-DEV] Re: [RFC][DISCUSSION] Argon2 Password Hash

2016-08-21 Thread Lauri Kenttä
On 2016-08-17 22:48, Charles R. Portwood II wrote: On Sat, Aug 6, 2016 at 12:55 PM, Charles R. Portwood II wrote: memory_cost = 1 MiB time_cost = 2 threads = 2 I'd like to gather some last feedback and make sure there aren't any serious objections to these cost factors (or anything else for

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Marco Pivetta
Including the question mark still breaks code-gen based on simple nullable types. PHP 7.0.x-compliant code will do following: - reflect function foo(Bar $bar = null) {} - cast ReflectionType to string - crash (unrecognized `?` symbol) That's part of what I tested on Friday on just one of the m

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Levi Morrison
On Sun, Aug 21, 2016 at 9:07 AM, Levi Morrison wrote: > > > On Sun, Aug 21, 2016 at 8:37 AM, Aaron Piotrowski > wrote: > >> Hi Marco, >> >> > On Aug 19, 2016, at 1:31 PM, Marco Pivetta wrote: >> > >> > Hi Aaron et all, >> > >> > I tried to implement support for 7.1 in zend-code as a start: >> >

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Levi Morrison
On Sun, Aug 21, 2016 at 8:37 AM, Aaron Piotrowski wrote: > Hi Marco, > > > On Aug 19, 2016, at 1:31 PM, Marco Pivetta wrote: > > > > Hi Aaron et all, > > > > I tried to implement support for 7.1 in zend-code as a start: > > > > https://github.com/zendframework/zend-code/pull/87 > > > > A few iss

Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names

2016-08-21 Thread Aaron Piotrowski
Hi Marco, > On Aug 19, 2016, at 1:31 PM, Marco Pivetta wrote: > > Hi Aaron et all, > > I tried to implement support for 7.1 in zend-code as a start: > > https://github.com/zendframework/zend-code/pull/87 > > A few issues arise: > > * `ReflectionType#__toString()` is too volatile, especially