Re: [PHP-DEV] [Discussion] HKDF

2017-01-16 Thread Yasuo Ohgaki
Hi Andrey, On Mon, Jan 16, 2017 at 8:16 PM, Andrey Andreev wrote: > > On Mon, Jan 16, 2017 at 3:47 AM, Yasuo Ohgaki wrote: > >> Nice function, I like it. >> Modified patch is committed to master >> http://git.php.net/?p=php-src.git;a=commitdiff;h=4bf7ef08061 >> 720586cb0a2f410720e26719d97f3 >>

Re: [PHP-DEV] [Discussion] HKDF

2017-01-16 Thread Yasuo Ohgaki
Hi fsb, On Tue, Jan 17, 2017 at 3:47 AM, fsb wrote: > > - when salt is ''(empty string), use default static known random salt >> value. >>Note: hkdf's salt could be known, yet provide stronger result as RFC >> states. >> > > This change renders the implementation nonstandard. And it's useles

Re: [PHP-DEV] [Discussion] HKDF

2017-01-16 Thread Yasuo Ohgaki
Hi Nikita, On Mon, Jan 16, 2017 at 8:08 PM, Nikita Popov wrote: > Making the salt required makes no sense to me. > It does not make sense to me too if API requires a "salt value" always. "salt" should be able to be omitted. My proposal is to "make salt parameter required" and "let programmers

Re: [PHP-DEV] Re: Improving mt_rand() seed

2017-01-16 Thread Yasuo Ohgaki
Hi Lauri, On Tue, Jan 17, 2017 at 2:34 AM, Lauri Kenttä wrote: > On Mon, Jan 16, 2017 at 4:04 PM, Yasuo Ohgaki wrote: > >> We know this kind of seed is guessable. i.e. Our session id is compromised >> by this kind of code. >> > > Maybe you should fix session id instead of (or in addition to) mt

Re: [PHP-DEV][RFC][DISCUSSION] - Immutable classes and properties

2017-01-16 Thread Stanislav Malyshev
Hi! > Discussion is open for following rfc https://wiki.php.net/rfc/immutability The RFC says: > Safe for concurrency. I'm not sure - what concurrency are you talking about? > Value objects, DTO's etc. can be easily created. Value objects can be easily created right now if you follow generic

Re: [PHP-DEV] Improving mail() 5th parameter handling

2017-01-16 Thread Stanislav Malyshev
Hi! > - Allow array additional_parameter and soft deprecate (document > deprecation) string one. > - Use key as "option name" and validate chars > - Use value as "option value" and validate some control chars then apply > escapeshellarg() Making array sounds good, but I'm not sure what is mean

Re: [PHP-DEV] bugsnet cleanup

2017-01-16 Thread Stanislav Malyshev
Hi! > A lot of the time a feature request is just not enough; it requires at > least a good discussion, if not an RFC. True, but some people can not write an RFC, or not ready to do it, however they still can request and discuss features. > That there were feature requests open on bugsnet for mo

Re: [PHP-DEV] Re: Improving mt_rand() seed

2017-01-16 Thread Lauri Kenttä
On Mon, Jan 16, 2017 at 4:04 PM, Yasuo Ohgaki wrote: We know this kind of seed is guessable. i.e. Our session id is compromised by this kind of code. Maybe you should fix session id instead of (or in addition to) mt_rand. On 2017-01-16 09:16, Yasuo Ohgaki wrote: Comments are appreciated.

RE: [PHP-DEV] Exposing jsonSerialize's depth

2017-01-16 Thread Jani Ollikainen
Hi, > Even if you leave the interface as is and just pass the parameter > additionally, it could have been extended by users just like in your example > and pass a > wrong value then. Yes, it might. I don't come up an idea why, but maybe someone has had a reason, as the json_encode calling won

Re: [PHP-DEV] Exposing jsonSerialize's depth

2017-01-16 Thread Niklas Keller
> > >> What BC break are you talking about? There is no need for using the > parameter in old codes. Even if we pass that depth to jsonSerialize > >> doing something like: "public function jsonSerialize() {...}" will > still work without any problems. > > That BC break: https://3v4l.org/L1u7q > > A

[PHP-DEV] BAD Benchmark Results for PHP Master 2017-01-15

2017-01-16 Thread lp_benchmark_robot
Results for project PHP master, build date 2017-01-15 20:29:01-08:00 commit: 4eb4057 previous commit:c4e0ba0 revision date: 2017-01-15 18:42:48-08:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

RE: [PHP-DEV] Exposing jsonSerialize's depth

2017-01-16 Thread Jani Ollikainen
Hi. >> What BC break are you talking about? There is no need for using the >> parameter in old codes. Even if we pass that depth to jsonSerialize >> doing something like: "public function jsonSerialize() {...}" will still >> work without any problems. > That BC break: https://3v4l.org/L1u7q And

Re: [PHP-DEV] Exposing jsonSerialize's depth

2017-01-16 Thread Jakub Zelenka
On Mon, Jan 16, 2017 at 8:19 AM, Jani Ollikainen wrote: > Hi, > > > I don't really like this. The reason is that you don't actually modify > JsonSerializable interface for the obvious BC break that it would cause it. > It means that the > function just gets this parameter and it kind of raises >

Re: [PHP-DEV] [Discussion] HKDF

2017-01-16 Thread Jakub Zelenka
On Wed, Jan 11, 2017 at 2:24 PM, Andrey Andreev wrote: > Hi all, > > There's a pending GitHub pull request of mine to include a HKDF > implementation into ext/hash. > Mostly anybody who saw it agreed that it probably doesn't require an RFC > vote, but I hadn't originally announced it here on the

Re: [PHP-DEV] [Discussion] HKDF

2017-01-16 Thread Andrey Andreev
Hi, On Mon, Jan 16, 2017 at 3:47 AM, Yasuo Ohgaki wrote: > Nice function, I like it. > Modified patch is committed to master > http://git.php.net/?p=php-src.git;a=commitdiff;h=4bf7ef08061 > 720586cb0a2f410720e26719d97f3 > > I have 2 improvement ideas. > > > > 1) Make salt parameter required. > >

Re: [PHP-DEV] [Discussion] HKDF

2017-01-16 Thread Nikita Popov
On Mon, Jan 16, 2017 at 2:47 AM, Yasuo Ohgaki wrote: > Hi all, > > On Wed, Jan 11, 2017 at 11:24 PM, Andrey Andreev wrote: > > > Hi all, > > > > There's a pending GitHub pull request of mine to include a HKDF > > implementation into ext/hash. > > Mostly anybody who saw it agreed that it probably

Re: [PHP-DEV] Exposing jsonSerialize's depth

2017-01-16 Thread Niklas Keller
2017-01-16 9:19 GMT+01:00 Jani Ollikainen : > Hi, > > > I don't really like this. The reason is that you don't actually modify > JsonSerializable interface for the obvious BC break that it would cause it. > It means that the > function just gets this parameter and it kind of raises > a question ho

Re: [PHP-DEV] Unsetting declared fields

2017-01-16 Thread Marco Pivetta
Hi Michał, On Mon, Jan 16, 2017 at 10:30 AM, Michał Brzuchalski wrote: > As I am familiar with those interceptions, I tend to point out some dirty > hacks > when reflection tells you property exists while getting notice on set, see > https://3v4l.org/VDMHm > > > class Foo > { > public $bar

Re: [PHP-DEV] Unsetting declared fields

2017-01-16 Thread Michał Brzuchalski
As I am familiar with those interceptions, I tend to point out some dirty hacks when reflection tells you property exists while getting notice on set, see https://3v4l.org/VDMHm bar); } } $foo = new FooHack(new Foo); $reflectionFooBar = new \ReflectionProperty(Foo::class, 'bar'); var_dump((n

Re: [PHP-DEV] Unsetting declared fields

2017-01-16 Thread Marco Pivetta
On Mon, Jan 16, 2017 at 9:49 AM, Michał Brzuchalski wrote: > Hi Marco, > > 2017-01-16 0:27 GMT+01:00 Marco Pivetta : > >> Hi Wes, >> >> This has been discussed before, and it's currently used to intercept >> access >> to properties. Since we don't have property accessors (sigh), the code >> (simp

Re: [PHP-DEV] Unsetting declared fields

2017-01-16 Thread Michał Brzuchalski
2017-01-16 9:49 GMT+01:00 Michał Brzuchalski : > Hi Marco, > > 2017-01-16 0:27 GMT+01:00 Marco Pivetta : > >> Hi Wes, >> >> This has been discussed before, and it's currently used to intercept >> access >> to properties. Since we don't have property accessors (sigh), the code >> (simplified versio

Re: [PHP-DEV] Unsetting declared fields

2017-01-16 Thread Michał Brzuchalski
Hi Marco, 2017-01-16 0:27 GMT+01:00 Marco Pivetta : > Hi Wes, > > This has been discussed before, and it's currently used to intercept access > to properties. Since we don't have property accessors (sigh), the code > (simplified version) would look like following: > > class Foo > { > public $

RE: [PHP-DEV] Exposing jsonSerialize's depth

2017-01-16 Thread Jani Ollikainen
Hi, > This looks like a hack covering for deficient design. Having objects that > look differently depending on hidden parameters without anybody explicitly > modifying them is a recipe for very hard to track bugs. I don't think we > should encourage this. > > There are ways to present serialize

RE: [PHP-DEV] Exposing jsonSerialize's depth

2017-01-16 Thread Jani Ollikainen
Hi, > I don't really like this. The reason is that you don't actually modify > JsonSerializable interface for the obvious BC break that it would cause it. > It means that the > function just gets this parameter and it kind of raises a > question how we should document it? The solution would be