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] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
@Fleshgrinder I will make changes that if immutable objects are being compared that they will be compared by value rather then hash On Sep 7, 2016 8:27 PM, "Christoph M. Becker" wrote: > On 07.09.2016 at 20:11, Fleshgrinder wrote: > > > On 9/7/2016 8:57 AM, Michał Brzuchalski wrote: > > > >> AFA

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Christoph M. Becker
On 07.09.2016 at 20:11, Fleshgrinder wrote: > On 9/7/2016 8:57 AM, Michał Brzuchalski wrote: > >> AFAIK CoW in case of objects would be impossible to implement. > > Nothing is impossible. :) > > We have full access to the real object inside of zend_std_write_property > and can easily clone it, p

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Fleshgrinder
First a general comment on cloning. Nothing bad happens if we allow cloning other than a performance hit. But only if we ensure that immutable objects are identified by value and not by the usual object hash. In case of the latter, as it is implemented right now, you end up with an exact copy but

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

2016-09-07 Thread Rowan Collins
On 06/09/2016 02:56, Yasuo Ohgaki wrote: Hi Rowan, On Fri, Sep 2, 2016 at 7:37 PM, Rowan Collins wrote: This certainly makes sense. I guess the challenge is that in order to know if data has been tampered, you need to have some knowledge of the expected format. That expectation depends on what

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] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Lars Strojny
Hi Davey, thanks for the proposal and excuse my rather longish reply already. > On 02 Sep 2016, at 21:32, Davey Shafik wrote: [...] > I'd like to introduce a new RFC to deprecate pear/pecl (in 7.2, and remove > in 8.0), as well as add composer/pickle (optional in 7.2, default in 7.3+) > in their

[PHP-DEV] GOOD Benchmark Results for PHP Master 2016-09-07

2016-09-07 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-09-07 06:24:55+03:00 commit: 5fccf64 previous commit:b15de5c revision date: 2016-09-06 22:20:25+02:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

[PHP-DEV] Even validating data it can still be wrong :)

2016-09-07 Thread Lester Caine
http://www.theregister.co.uk/2016/09/07/air_asia_x_navigation_system_typo_melbourne_malaysia/ The main thing that is obvious from the report is that there was a software patch due to be installed, but while the old software knew there was a problem it was not producing sensible warnings. Perhaps t

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Michael Wallner
Regards, Mike > On 02 09 2016, at 21:32, Davey Shafik wrote: > > Hi internals, > > I'd like to introduce a new RFC to deprecate pear/pecl (in 7.2, and remove > in 8.0), as well as add composer/pickle (optional in 7.2, default in 7.3+) > in their place. > > https://wiki.php.net/rfc/deprecate

[PHP-DEV] Re: [RFC][VOTE]: Argon2 Password Hash (Reopened)

2016-09-07 Thread Charles R. Portwood II
On Wed, Aug 24, 2016 at 10:49 AM, Charles R. Portwood II wrote: > Hello, > > The RFC for introducing Argon2 as an alternative hashing algorithm for the > password_* functions is now re-open. The RFC is available at > https://wiki.php.net/rfc/argon2_password_hash > . > > Voting is open for 2 week,

[PHP-DEV] Re: The death of `#ifndef FAST_ZPP`?

2016-09-07 Thread Andrea Faulds
Hi Christoph, Christoph M. Becker wrote: On 04.05.2016 at 18:11, Andrea Faulds wrote: It seems to me that the FAST_ZPP macro is not (only) to disable an experimental feature, but rather to be able to reduce the size of the built binaries. I've just checked a `./configure --disable-all`: wi

[PHP-DEV] Re: The death of `#ifndef FAST_ZPP`?

2016-09-07 Thread Christoph M. Becker
On 04.05.2016 at 18:11, Andrea Faulds wrote: > Since FAST_ZPP was implemented, many functions in built-in PHP > extensions look like this: > > […] > > That is, they have /two/ sets of parameter processing code: one using > the old API, and one using the new API, with conditional compilation. > Thi

RE: [PHP-DEV] Re: The death of `#ifndef FAST_ZPP`?

2016-09-07 Thread Zeev Suraski
> -Original Message- > From: Ferenc Kovacs [mailto:tyr...@gmail.com] > Sent: Wednesday, September 07, 2016 4:24 PM > To: Andrea Faulds > Cc: PHP Internals > Subject: Re: [PHP-DEV] Re: The death of `#ifndef FAST_ZPP`? > > On Tue, Sep 6, 2016 at 12:33 AM, Andrea Faulds wrote: > > > Hi

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
@Lester I might have expressed my self in a wrong way, there is not wrong with encapsulation. Thing is that there is no proper support and unified solution from the language. There are much examples of real world cases where this can be useful. I understand that same behaviour can be achieved on m

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Mathieu Rochette
On 07/09/2016 15:09, Michał Brzuchalski wrote: @Mathieu How about that: https://gist.github.com/brzuchal/e7b721e22a19cca42ec0d1f597a23baf We've discussed this could be best option, when invoking `transformer` method (or whatever we call it) there is `$this = clone $this` invoked under the hoo

Re: [PHP-DEV] Re: The death of `#ifndef FAST_ZPP`?

2016-09-07 Thread Ferenc Kovacs
On Tue, Sep 6, 2016 at 12:33 AM, Andrea Faulds wrote: > Hi again, > > I finally wrote a patch to get rid of it: > > https://github.com/php/php-src/pull/2118 > > Perhaps this will go somewhere. :) > > > -- > Andrea Faulds > https://ajf.me/ > > -- > PHP Internals - PHP Runtime Development Mailing L

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Lester Caine
On 07/09/16 10:28, Silvio Marijić wrote: > DateTimeImmutable does not prevent cloning because immutability is achieved > by encapsulation, and we want to get rid of the need of encapsulation in > our implementation of immutable objects. What is the problem with 'encapsulation'? By that I mean crea

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Michał Brzuchalski
@Mathieu How about that: https://gist.github.com/brzuchal/e7b721e22a19cca42ec0d1f597a23baf We've discussed this could be best option, when invoking `transformer` method (or whatever we call it) there is `$this = clone $this` invoked under the hood. 2016-09-07 14:53 GMT+02:00 Mathieu Rochette : >

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Mathieu Rochette
a few remarks on mutator methods: * It could be a nice way to solve the "create another one almost the same" use case. * I don't mind if $clone is an explicit parameter or magically available * what happens if I call other function/methods with this $clone before the end of the function

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Jonathan Wage
On Friday, September 2, 2016, Davey Shafik wrote: > Hi internals, > > I'd like to introduce a new RFC to deprecate pear/pecl (in 7.2, and remove > in 8.0), as well as add composer/pickle (optional in 7.2, default in 7.3+) > in their place. > > https://wiki.php.net/rfc/deprecate-pear-include-compo

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Stephen Reay
Well crap I just realised I hadn’t hit reply-all several replies ago!. I also just noticed that you had mentioned about allowing property writes only in __construct and __clone last week, and asked about how it might look. I wasn’t subscribed then so I didn’t see the earlier discussions. I’ll g

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
Ok, I have some time also so we can together try to write some initial implementation of that. 2016-09-07 14:10 GMT+02:00 Michał Brzuchalski : > Silvio, > > I can try with it tommorow, we'll see about that. > > > 2016-09-07 14:05 GMT+02:00 Silvio Marijić : > >> Michal, how much work do you estima

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Pierre Joye
On Sep 7, 2016 6:24 PM, "Lester Caine" wrote: > > On 07/09/16 12:02, Pierre Joye wrote: > > One point, pickle does not need composer to run. > > > > pickle install memcache will install the memcache extension (windows > > binaries, from pecl.php.net, etc) straight away. > > That one is useful to

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Michał Brzuchalski
Silvio, I can try with it tommorow, we'll see about that. 2016-09-07 14:05 GMT+02:00 Silvio Marijić : > Michal, how much work do you estimate it would take us to implement method > modificator solution? > > 2016-09-07 14:01 GMT+02:00 Michał Brzuchalski : > >> Hi, >> >> Frozing an immutable objec

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
Michal, how much work do you estimate it would take us to implement method modificator solution? 2016-09-07 14:01 GMT+02:00 Michał Brzuchalski : > Hi, > > Frozing an immutable object after it's creation is most important feature > of Immutable Classes. > Without it you cannot have guarantee it's

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Michał Brzuchalski
Hi, Frozing an immutable object after it's creation is most important feature of Immutable Classes. Without it you cannot have guarantee it's internal state is consistent as it was during creation. Having methods access to write is quite dangerous - think about CLosure binded to immutable object -

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Lester Caine
On 07/09/16 12:37, Rowan Collins wrote: > On 07/09/2016 11:51, Lester Caine wrote: >> This comes down simply to 'education', and just as we provide migration >> guides to check deprecated code and help re-write it there needs to be >> the same sort of guideline - provided by PHP - as to how compose

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Rowan Collins
On 07/09/2016 11:51, Lester Caine wrote: This comes down simply to 'education', and just as we provide migration guides to check deprecated code and help re-write it there needs to be the same sort of guideline - provided by PHP - as to how composer or what ever can be used to replace the previou

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Lester Caine
On 07/09/16 12:02, Pierre Joye wrote: > One point, pickle does not need composer to run. > > pickle install memcache will install the memcache extension (windows > binaries, from pecl.php.net, etc) straight away. That one is useful to know. I have all my own active pear stuff under the code repo

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Pierre Joye
On Wed, Sep 7, 2016 at 5:51 PM, Lester Caine wrote: > On 07/09/16 10:58, Rowan Collins wrote: > People who already know composer, as perhaps it's all they have ever > used, are at an advantage. I've tried a couple of times to pick up a > library that NOW has a composer option, Smarty is a case in

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Lester Caine
On 07/09/16 10:58, Rowan Collins wrote: > > If anything, the Composer approach is simpler to deploy, because you can > create a tar ball of the whole project with a populated vendor > directory, and copy it straight to production. (I believe that's > possible with PEAR, too, but not when using the

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
@Stephan I am against that any kind of method can make modification on original object. Cloning can be allowed but for this use case where you would pass properties that are changing, we would have to modify syntax of clone On Sep 7, 2016 12:37 PM, "Stephen Reay" wrote: > Hey Matheiu, Silvio, >

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Stephen Reay
Hey Matheiu, Silvio, That is my main concern with the inability to clone from outside the class. I don’t think immutable should cause an error in this situation - if you really don’t want to allow users to create objects they can’t modify (which I understand) could clone on an immutable object

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
@Mathieu, Object can not be modified neither internally or externally, question is if you clone object where should we allow modification of cloned object On Sep 7, 2016 12:13 PM, "Mathieu Rochette" wrote: > > > On 07/09/2016 11:05, Stephen Reay wrote: > >> (Sorry for any dupes, sent from wrong

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Mathieu Rochette
On 07/09/2016 11:05, Stephen Reay wrote: (Sorry for any dupes, sent from wrong address originally) From a developer point of view, I would suggest that a feature should aim to be as clear to understand with as little “magic" as possible. If the goal of an immutable class is to allow public

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Mathieu Rochette
On 07/09/2016 11:28, Silvio Marijić wrote: Hi Stephen, Cloning is disabled at the moment in implementation because you would end up with a object that you can not change, so you have no use of that. I'll change that as soon as we find some good solution for handling that. Your example is not r

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Rowan Collins
On 07/09/2016 10:33, Lester Caine wrote: This does highlight the different approach to handling things in a production environment over a development one. The problems I have seen IS when composer.lock gets replaced by mistake, or when an update picks up a change to a package that was not actuall

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Mathieu Rochette
On 07/09/2016 11:33, Lester Caine wrote: On 07/09/16 09:10, Ferenc Kovacs wrote: I can only report what I have read in various newsgroups and forums, and they have said that composer has screwed up their installations. If it is capable of doing that then it is a serious issue that needs addre

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Niklas Keller
2016-09-07 11:33 GMT+02:00 Lester Caine : > On 07/09/16 09:10, Ferenc Kovacs wrote: > >> I can only report what I have read in various newsgroups and forums, and > >> > they have said that composer has screwed up their installations. If > it is > >> > capable of doing that then it is a serious iss

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

2016-09-07 Thread Lester Caine
On 07/09/16 10:19, Lester Caine wrote: > If the definition of a variable is > improved to include ALL of the validation we ideally need and I include > setStrict(int) in that then at run time we can both validate input and > decide on the error model that is applied. And I know I will get my head

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
And also Fleshgrinder made a good point about comparing two immutable objects. They should be compared based on value, not on identity. 2016-09-07 11:28 GMT+02:00 Silvio Marijić : > Hi Stephen, > > Cloning is disabled at the moment in implementation because you would end > up with a object that y

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Lester Caine
On 07/09/16 09:10, Ferenc Kovacs wrote: >> I can only report what I have read in various newsgroups and forums, and >> > they have said that composer has screwed up their installations. If it is >> > capable of doing that then it is a serious issue that needs addressing. > > you can, but you shoul

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Silvio Marijić
Hi Stephen, Cloning is disabled at the moment in implementation because you would end up with a object that you can not change, so you have no use of that. I'll change that as soon as we find some good solution for handling that. Your example is not really clear to me. At what point we should unlo

[PHP-DEV] Re: PHP_INI_MH()'s new_value_length being non-zero for NULL new_value?

2016-09-07 Thread Yasuo Ohgaki
On Wed, Sep 7, 2016 at 5:46 PM, Yasuo Ohgaki wrote: > I realized that setting default_charset does not set > *.internal_encoding/etc. So I looked into what's wrong and found > > PHP_INI_MH()'s new_value_length being non-zero for NULL new_value. > > This makes fail to set proper value for *.interma

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

2016-09-07 Thread Lester Caine
On 06/09/16 23:57, Yasuo Ohgaki wrote: > It may differ from your software security model. Programmers are free > to choose which model to adopt. However, one shouldn't disturb > mandatory tool implementation for recommended security model by secure > coding specialists, IMHO. If you don't like/need

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Pierre Joye
hi Tony, On Wed, Sep 7, 2016 at 2:52 PM, Tony Marston wrote: > "Pierre Joye" wrote in message > news:CAEZPtU6aHYb9HsNXbXWp9q9PMoLYiJp=n1rjmspofmhbebd...@mail.gmail.com... > >> Happy to see there are still users for this tool, Christian and I had >> good fun writing it. Also you should know that

Re: [PHP-DEV] RFC - Immutable classes

2016-09-07 Thread Stephen Reay
(Sorry for any dupes, sent from wrong address originally) From a developer point of view, I would suggest that a feature should aim to be as clear to understand with as little “magic" as possible. If the goal of an immutable class is to allow public properties to be made read-only, my expectat

[PHP-DEV] PHP_INI_MH()'s new_value_length being non-zero for NULL new_value?

2016-09-07 Thread Yasuo Ohgaki
Hi all, I realized that setting default_charset does not set *.internal_encoding/etc. So I looked into what's wrong and found PHP_INI_MH()'s new_value_length being non-zero for NULL new_value. This makes fail to set proper value for *.intermal_encoding/etc. This happens from PHP 5.6 branch. It w

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] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Michael Morris
On Wed, Sep 7, 2016 at 3:52 AM, Tony Marston wrote: > > > Typical. You create a useful tool, get your users hooked, then walk away > and leave them dangling. > > No one owes you anything. You aren't entitled to get free updates to a free tool. If the author wants to move onto other projects, that'

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] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Ferenc Kovacs
On Wed, Sep 7, 2016 at 9:49 AM, Tony Marston wrote: > "Ferenc Kovacs" wrote in message news:CAH-PCH5qHdYen33Q_s7kTKM_ > 8qk71v8ky6kt4fzurfawfx0...@mail.gmail.com... > >> >> >>> >>> Composer doesn't do that. >>> Then how come I've seen several complaints in various forums about >>> comp

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Tony Marston
"Pierre Joye" wrote in message news:CAEZPtU6aHYb9HsNXbXWp9q9PMoLYiJp=n1rjmspofmhbebd...@mail.gmail.com... Hi Tony, On Tue, Sep 6, 2016 at 2:17 PM, Tony Marston wrote: "Niklas Keller" wrote in message news:canuqdcjeh45_2aeq74cceoy4xc3xj0o_+yrq2nvy0k2vdox...@mail.gmail.com... Tony Marston

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Tony Marston
"Ferenc Kovacs" wrote in message news:cah-pch5qhdyen33q_s7ktkm_8qk71v8ky6kt4fzurfawfx0...@mail.gmail.com... Composer doesn't do that. Then how come I've seen several complaints in various forums about composer updating libraries in the background and screwing things up. That proves no

Re: [PHP-DEV] [RFC] Deprecate PEAR/PECL & Replace with composer/pickle

2016-09-07 Thread Christopher Jones
On 5/09/2016 8:13 PM, Derick Rethans wrote: On Fri, 2 Sep 2016, Davey Shafik wrote: I'd like to introduce a new RFC to deprecate pear/pecl (in 7.2, and remove in 8.0), as well as add composer/pickle (optional in 7.2, default in 7.3+) in their place. https://wiki.php.net/rfc/deprecate-pear-in