Re: [PHP-DEV][RFC][DISCUSSION] Immutability

2018-02-22 Thread Rowan Collins
On 20 February 2018 at 11:25, Nikita Popov  wrote:

> On Tue, Feb 20, 2018 at 12:20 PM, Silvio Marijić  >
> wrote:
>
> > Hi,
> > I am starting this discussion again after a year since this RFC was
> > created. From discussions with people in the community some suggestions
> > came up regarding issues that were main reason that development on this
> RFC
> > stopped. RFC is updated along with implementation (link at the bottom of
> > RFC). I'll be more then happy to answer all questions.
>
>
> Link: https://wiki.php.net/rfc/immutability :)



This definitely seems like an exciting addition to the language. Some
clarifications:


This sentence in the RFC is rather confusing, "Any references to objects
... cannot be references to scalars ... or may be ...". I think it's just
reiterating things said elsewhere in the RFC, but could maybe be reworded?

>  Any references to objects passed into an immutable class constructor
cannot be references to scalars or may be immutable class instances.

A set of bullet points of what types can and can't be assigned to an
immutable property might be useful.


The example under "references" shows a reference being successfully taken
to an immutable property, but then being considered immutable itself. Is
there any performance penalty to tracking this extra state? I know
references have caused problems in other cases, like the typed properties
RFC.


What kind of error is produced when you attempt to write to an immutable
property? I would expect some sub-class of Error to be thrown, but the RFC
currently just says a fatal error.

As I say, I like the idea, and thanks for working on it.

Regards,
-- 
Rowan Collins
[IMSoP]


[PHP-DEV] Re: [RFC] [Discussion] Arrays starting with a negative index

2018-02-22 Thread Pedro Magalhães
On Tue, Feb 13, 2018 at 8:03 PM, Pedro Magalhães  wrote:

> Hi internals,
>
> I want to bring up this RFC once again given that now seems to be the
> right timing for it. I have previously canceled the vote when I initially
> proposed this to land on 7.2 which was seen as too big of a BC for a minor
> version. On a second attempt targeting 8.0 I have also canceled the vote as
> the inclusion of a deprecation notice in cases where the behavior will
> change warranted further discussion.
>
> To address these issues, the current version of the RFC will have 2
> separate votes:
> - Introduce the new behavior on 8.0
> - Introduce a deprecation notice on 7.3
>
> For those not familiar with the RFC, the general idea is that currently,
> any array that has a number n as it's first numeric key will have for it's
> next implicit key either n+1 if n >= 0 or 0 if n < 0. This RFC proposes to
> make this consistent by always using n+1 regardless of the sign of n.
> In code:
> $a[-2] = true; // Current: Key is -2, RFC: Key is -2
> $a[] = true; // Current: Key is 0, RFC: Key is -1
> $a[] = true; // Current: Key is 1, RFC: Key is 0
>
> I invite you to read the full RFC: https://wiki.php.net/rfc/
> negative_array_index and bring up any issues you see with the current
> version before the voting period starts.
>
> Looking forward for any feedback.
>
> Regards,
> Pedro Magalhães
>

Hi internals,

I'd like to open the voting for this RFC in 5 days (27/2).
Please bring up any feedback you may have about it before the voting period
starts.

Thanks in advance,
Pedro Magalhães


[PHP-DEV] Re: [RFC] is_countable

2018-02-22 Thread Gabriel Caruso
>
> Hello, dear Internals.
>
> First, thanks to Niklas Keller for giving me permission to write an *RFC*!
> After that, I like to propose and discuss a new function for PHP 7.x
> (current 7.3): is_countable.
>
> *RFC*: https://wiki.php.net/rfc/is-countable.
>
> I tried to describe everything there, but of course, let's discuss
> everything that should be improved to get this functions merged into the
> Core.
>
> Thanks,
>
> --
> Gabriel Caruso
>


 Hello again, dear internals.

One month since the `is_countable` RFC had open.

We have add the support for `count_elements` (thanks @duncan3dc), so we can
use this function with internal classes as well.

There's only one open discussion from @morrisonlevi, but I do believe is
related to arginfo return type, which isn't used in the core yet, so I kept
without it.

Is something else we should do it, or I can open the voting next week
(26/02)?


-- 
Gabriel Caruso


Re: [PHP-DEV] Re: [RFC] [Discussion] Arrays starting with a negative index

2018-02-22 Thread Niklas Keller
Hey,

"Will no longer produce any output." in the BC example is wrong, it
will produce a notice due to an undefined index then.

> NOTE: If accepted, during the deprecation phase the following E_DEPRECATED 
> notice would be emitted in cases where the behavior will change:

I guess that means also $a[-3] = true; $a[] = false; will emit a
deprecation notice?

Regards, Niklas

2018-02-22 18:38 GMT+01:00 Pedro Magalhães :
> On Tue, Feb 13, 2018 at 8:03 PM, Pedro Magalhães  wrote:
>
>> Hi internals,
>>
>> I want to bring up this RFC once again given that now seems to be the
>> right timing for it. I have previously canceled the vote when I initially
>> proposed this to land on 7.2 which was seen as too big of a BC for a minor
>> version. On a second attempt targeting 8.0 I have also canceled the vote as
>> the inclusion of a deprecation notice in cases where the behavior will
>> change warranted further discussion.
>>
>> To address these issues, the current version of the RFC will have 2
>> separate votes:
>> - Introduce the new behavior on 8.0
>> - Introduce a deprecation notice on 7.3
>>
>> For those not familiar with the RFC, the general idea is that currently,
>> any array that has a number n as it's first numeric key will have for it's
>> next implicit key either n+1 if n >= 0 or 0 if n < 0. This RFC proposes to
>> make this consistent by always using n+1 regardless of the sign of n.
>> In code:
>> $a[-2] = true; // Current: Key is -2, RFC: Key is -2
>> $a[] = true; // Current: Key is 0, RFC: Key is -1
>> $a[] = true; // Current: Key is 1, RFC: Key is 0
>>
>> I invite you to read the full RFC: https://wiki.php.net/rfc/
>> negative_array_index and bring up any issues you see with the current
>> version before the voting period starts.
>>
>> Looking forward for any feedback.
>>
>> Regards,
>> Pedro Magalhães
>>
>
> Hi internals,
>
> I'd like to open the voting for this RFC in 5 days (27/2).
> Please bring up any feedback you may have about it before the voting period
> starts.
>
> Thanks in advance,
> Pedro Magalhães

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: [RFC] [Discussion] Arrays starting with a negative index

2018-02-22 Thread Pedro Magalhães
Hi Niklas,

On Thu, Feb 22, 2018 at 8:38 PM, Niklas Keller  wrote:

> Hey,
>
> "Will no longer produce any output." in the BC example is wrong, it
> will produce a notice due to an undefined index then.
>
>
That's right. I've updated the RFC to make that section more clear.
Including that the example would also emit the deprecation notice.

> NOTE: If accepted, during the deprecation phase the following
> E_DEPRECATED notice would be emitted in cases where the behavior will
> change:
>
> I guess that means also $a[-3] = true; $a[] = false; will emit a
> deprecation notice?
>

Yes, it would.

Thanks,
Pedro


Re: [PHP-DEV] FPM maintainership?

2018-02-22 Thread Stanislav Malyshev
Hi!

> I already work on it and not sure if there is any other dev actively
> works on it so I would be happy to step up as a maintainer whatever it
> means :) I want however keep working on my plan so the current priority
> is to sort the logging out because it is causing many issues.

Great! There are also a number of issues in the bug db for FPM that
could use a review, and I am not sure what to do about
https://bugs.php.net/bug.php?id=75605 specifically...

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] FPM maintainership?

2018-02-22 Thread Stanislav Malyshev
Hi!

> I already work on it and not sure if there is any other dev actively
> works on it so I would be happy to step up as a maintainer whatever it
> means :) I want however keep working on my plan so the current priority
> is to sort the logging out because it is causing many issues.

Great! There are also a number of issues in the bug db for FPM that
could use a review, and I am not sure what to do about
https://bugs.php.net/bug.php?id=75605 specifically...

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php