Re: [PHP-DEV] Add a new flag for json_encode

2014-12-15 Thread Ferenc Kovacs
On Mon, Dec 15, 2014 at 6:16 PM, Juan Basso wrote: > > Ok guys, sorry, but I am giving up on it. > > I opened the PR in April and all the code necessary with technical > implications are done and registered on the PR. I brought the topic to this > email list in November as requested in the PR and

Re: [PHP-DEV] Add a new flag for json_encode

2014-12-15 Thread Juan Basso
Ok guys, sorry, but I am giving up on it. I opened the PR in April and all the code necessary with technical implications are done and registered on the PR. I brought the topic to this email list in November as requested in the PR and almost 1 month after you guys requested me to write a RFC. I tr

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-30 Thread Juan Basso
I see. I thought it was some sort of simplified RFC. :) Ok, I will create a RFC regarding it. On Sun, Nov 30, 2014 at 8:49 PM, Andrea Faulds wrote: > > > On 1 Dec 2014, at 01:48, Juan Basso wrote: > > > > What is ofc? I never heard about it before. Do I need to do something? > > “ofc” is just

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-30 Thread Andrea Faulds
> On 1 Dec 2014, at 01:48, Juan Basso wrote: > > What is ofc? I never heard about it before. Do I need to do something? “ofc” is just an abbreviation for “of course”. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-30 Thread Juan Basso
What is ofc? I never heard about it before. Do I need to do something? Thanks. Juan Basso On Sat, Nov 29, 2014 at 5:45 AM, Ferenc Kovacs wrote: > > > On Sat, Nov 29, 2014 at 5:39 AM, Levi Morrison wrote: > >> On Fri, Nov 28, 2014 at 1:21 PM, Juan Basso wrote: >> > Over 20 days since the last

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-29 Thread Ferenc Kovacs
On Sat, Nov 29, 2014 at 5:39 AM, Levi Morrison wrote: > On Fri, Nov 28, 2014 at 1:21 PM, Juan Basso wrote: > > Over 20 days since the last comment and seems there is a consensus about > > accept it to the next 5.6 patch version, right? Can it be merged? > > After reading over the thread, there d

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-29 Thread Kris Craig
On Nov 3, 2014 7:13 PM, "Juan Basso" wrote: > > Hi, > > I opened a pull request[1] in order to solve the bug 50224[2] and it ended > creating this pull request to add a new flag called > JSON_PRESERVE_FRACTIONAL_PART on json_encode function. This flag will make > the json encode to output float nu

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-28 Thread Juan Basso
Levi, >From what I understood it is a consensus to apply the change to PHP 5.6 as it is (new flag and disabled by default). There is no consensus about how should be in PHP 7, but was agreed to discuss that later. On Fri, Nov 28, 2014 at 11:39 PM, Levi Morrison wrote: > On Fri, Nov 28, 2014 at

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-28 Thread Levi Morrison
On Fri, Nov 28, 2014 at 1:21 PM, Juan Basso wrote: > Over 20 days since the last comment and seems there is a consensus about > accept it to the next 5.6 patch version, right? Can it be merged? After reading over the thread, there doesn't seem to be a consensus; I am not sure how you arrived at t

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-28 Thread Juan Basso
Over 20 days since the last comment and seems there is a consensus about accept it to the next 5.6 patch version, right? Can it be merged? Juan Basso On Wed, Nov 5, 2014 at 9:37 PM, Juan Basso wrote: > After the comments I see about deprecating the constant. Makes completely > sense to keep it.

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Juan Basso
After the comments I see about deprecating the constant. Makes completely sense to keep it. Thanks for the clarification. I like the idea to have it enabled by default on 7.0, but since it is not a major issue, probably keeping it as optional would makes more sense and doesn't introduce another un

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Ferenc Kovacs
On Wed, Nov 5, 2014 at 6:24 PM, Andrea Faulds wrote: > > > On 5 Nov 2014, at 17:01, Ferenc Kovacs wrote: > > > > 2, there is a chance that there are some exotic apps/systems which are > > already depending on the fact that php will/was used to send out 1 > instead > > of 1.0, and while we can br

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Chris Wright
On 5 November 2014 17:21, Jakub Zelenka wrote: > > > On Wed, Nov 5, 2014 at 4:52 PM, Chris Wright wrote: > >> >> I'm sorry, but I don't understand why it would need to be deprecated. For >> me "making it the default behaviour" would mean "changing the default value >> of the $flags argument to J

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Andrea Faulds
> On 5 Nov 2014, at 17:01, Ferenc Kovacs wrote: > > 2, there is a chance that there are some exotic apps/systems which are > already depending on the fact that php will/was used to send out 1 instead > of 1.0, and while we can break BC in a major release, the migration for > those people would b

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Jakub Zelenka
On Wed, Nov 5, 2014 at 4:52 PM, Chris Wright wrote: > > I'm sorry, but I don't understand why it would need to be deprecated. For > me "making it the default behaviour" would mean "changing the default value > of the $flags argument to JSON_PRESERVE_FACTIONAL_PART". The flag would > still functio

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Ferenc Kovacs
On Wed, Nov 5, 2014 at 5:34 PM, Jakub Zelenka wrote: > > > On Wed, Nov 5, 2014 at 4:23 PM, Juan Basso wrote: > >> >> I also prefer to use ​different flags if we enable by default. So if this >> behavior is enabled by default in 7.0 the JSON_PRESERVE_FRACTIONAL_PART >> is deprecated and a new fla

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Chris Wright
On 5 November 2014 16:45, Jakub Zelenka wrote: > > On Wed, Nov 5, 2014 at 2:33 PM, Chris Wright wrote >> >> >> I'm afraid I have to disagree here, I don't like the idea of changing >> this behaviour without making it controllable >> > > If we make it default, then we could of course add a new co

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Andrea Faulds
> On 5 Nov 2014, at 16:45, Jakub Zelenka wrote: > > On Wed, Nov 5, 2014 at 2:33 PM, Chris Wright wrote >> >> >> I'm afraid I have to disagree here, I don't like the idea of changing this >> behaviour without making it controllable >> > > If we make it default, then we could of course add a

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Jakub Zelenka
On Wed, Nov 5, 2014 at 2:33 PM, Chris Wright wrote > > > I'm afraid I have to disagree here, I don't like the idea of changing this > behaviour without making it controllable > If we make it default, then we could of course add a new constants that would allow the old behaviour. What I'm trying

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Jakub Zelenka
On Wed, Nov 5, 2014 at 4:23 PM, Juan Basso wrote: > > I also prefer to use ​different flags if we enable by default. So if this > behavior is enabled by default in 7.0 the JSON_PRESERVE_FRACTIONAL_PART > is deprecated and a new flag is created to disable it. > > In resume of this thread, seems ev

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Andrea Faulds
> On 5 Nov 2014, at 16:23, Juan Basso wrote: > > Andrea, I see your concerns about the bigint changes, but I am not sure if > they are related. The PR just affect the encoding, not the decoding part. Yes, I realise that. > So if some Python system encodes a JSON using the decimal part it will

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Jakub Zelenka
On Wed, Nov 5, 2014 at 2:33 PM, Chris Wright wrote: > > I'm afraid I have to disagree here, I don't like the idea of changing this > behaviour without making it controllable, and your logic is also slightly > flawed - it's not that you'd have to do an & ~ to disable, it's that it > wouldn't be en

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Juan Basso
I also prefer to use ​different flags if we enable by default. So if this behavior is enabled by default in 7.0 the JSON_PRESERVE_FRACTIONAL_PART is deprecated and a new flag is created to disable it. In resume of this thread, seems everyone if fine in having the flag JSON_PRESERVE_FRACTIONAL_PART

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-05 Thread Chris Wright
On 4 November 2014 17:07, Jakub Zelenka wrote: > On Tue, Nov 4, 2014 at 2:57 PM, Ferenc Kovacs wrote: > > > On Tue, Nov 4, 2014 at 4:13 AM, Juan Basso wrote: > > > > > Hi, > > > > > > I opened a pull request[1] in order to solve the bug 50224[2] and it > > ended > > > creating this pull request

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Andrea Faulds
> On 4 Nov 2014, at 20:06, Jakub Zelenka wrote: > > That's a good point. However I still think that there are more advantages for > making this the default. I like mainly the idea that > json_decode(json_encode($a)) = $a for all floats which is not the case at the > moment. Also it allow some

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Jakub Zelenka
Hi, On Tue, Nov 4, 2014 at 6:14 PM, Andrea Faulds wrote: > > > On 4 Nov 2014, at 17:07, Jakub Zelenka wrote: > > > > I would really like to see it as default in the next major as it is a > > useful feature. > > > > However I don't like adding new flag. The reason for that is that it > > becomes

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Andrea Faulds
> On 4 Nov 2014, at 17:07, Jakub Zelenka wrote: > > I would really like to see it as default in the next major as it is a > useful feature. > > However I don't like adding new flag. The reason for that is that it > becomes useless after 7 is realesed. It would be useful only for >5.6.3 and > <7

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Andrea Faulds
> On 4 Nov 2014, at 16:41, Ferenc Kovacs wrote: > > > > On Tue, Nov 4, 2014 at 5:35 PM, Andrea Faulds wrote: > > > On 4 Nov 2014, at 14:57, Ferenc Kovacs wrote: > > > > Hi, > > > > just a slight correction: > > as far as I can tell, Jakus was ok with the general idea and even with > > turni

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Jakub Zelenka
On Tue, Nov 4, 2014 at 2:57 PM, Ferenc Kovacs wrote: > On Tue, Nov 4, 2014 at 4:13 AM, Juan Basso wrote: > > > Hi, > > > > I opened a pull request[1] in order to solve the bug 50224[2] and it > ended > > creating this pull request to add a new flag called > > JSON_PRESERVE_FRACTIONAL_PART on jso

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Ferenc Kovacs
On Tue, Nov 4, 2014 at 5:35 PM, Andrea Faulds wrote: > > > On 4 Nov 2014, at 14:57, Ferenc Kovacs wrote: > > > > Hi, > > > > just a slight correction: > > as far as I can tell, Jakus was ok with the general idea and even with > > turning this into the default, but he stated that it should only h

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Andrea Faulds
> On 4 Nov 2014, at 14:57, Ferenc Kovacs wrote: > > Hi, > > just a slight correction: > as far as I can tell, Jakus was ok with the general idea and even with > turning this into the default, but he stated that it should only happen in > a major version (as it would cause a slight BC, maybe thi

Re: [PHP-DEV] Add a new flag for json_encode

2014-11-04 Thread Ferenc Kovacs
On Tue, Nov 4, 2014 at 4:13 AM, Juan Basso wrote: > Hi, > > I opened a pull request[1] in order to solve the bug 50224[2] and it ended > creating this pull request to add a new flag called > JSON_PRESERVE_FRACTIONAL_PART on json_encode function. This flag will make > the json encode to output flo

[PHP-DEV] Add a new flag for json_encode

2014-11-03 Thread Juan Basso
Hi, I opened a pull request[1] in order to solve the bug 50224[2] and it ended creating this pull request to add a new flag called JSON_PRESERVE_FRACTIONAL_PART on json_encode function. This flag will make the json encode to output float number always with decimal part, even when it is 0. Current