Re: [PHP-DEV] Re: Proposal for RFC to remove undefined array indexwarning when used ina ternary

2022-02-26 Thread Mark Randall
On 26/02/2022 22:34, Robert Landers wrote: This is not semantically the same though. A $_POST of a form, for example, will usually contain an empty value if the form input was empty, but missing if the form control wasn't in the form (maybe the form control is injected via Javascript, or

Re: [PHP-DEV] Re: Proposal for RFC to remove undefined array index warning when used ina ternary

2022-02-26 Thread Kamil Tekiela
I just wanted to add that the following $name = $_POST['name'] ?: 'Default Name'; with existence check would be $name = $_POST['name'] ?? null ?: 'Default Name'; You don't need empty(). I would be against changing the behaviour of elvis/ternary operator. However, I remember seeing past

Re: [PHP-DEV] Re: Proposal for RFC to remove undefined array index warning when used ina ternary

2022-02-26 Thread Robert Landers
On Sat, Feb 26, 2022 at 11:34 PM Robert Landers wrote: > On Sat, Feb 26, 2022 at 5:35 PM Mark Randall wrote: > >> On 26/02/2022 09:09, Robert Landers wrote: >> > I'd like to propose and implement an RFC that would consider dropping >> the >> > warning if and only if array access is the only

Re: [PHP-DEV] Re: Proposal for RFC to remove undefined array index warning when used ina ternary

2022-02-26 Thread Robert Landers
On Sat, Feb 26, 2022 at 5:35 PM Mark Randall wrote: > On 26/02/2022 09:09, Robert Landers wrote: > > I'd like to propose and implement an RFC that would consider dropping the > > warning if and only if array access is the only test in ternary and short > > ternary (?:) operations but first I'd

[PHP-DEV] Re: Proposal for RFC to remove undefined array index warning when used ina ternary

2022-02-26 Thread Mark Randall
On 26/02/2022 09:09, Robert Landers wrote: I'd like to propose and implement an RFC that would consider dropping the warning if and only if array access is the only test in ternary and short ternary (?:) operations but first I'd like to start a discussion to see if it is worth pursuing. I'd like

Re: [PHP-DEV] SensitiveParameterValue serialization behavior

2022-02-26 Thread Claude Pache
> > 1. Disallow both serialization and unserialization. > > This will make the serialization issue very obvious, but will require > adjustments to exception handlers that serialize the stack traces. Hi, Note that exception handlers that serialise stack traces without taking into account

Re: [PHP-DEV] SensitiveParameterValue serialization behavior

2022-02-26 Thread Dan Ackroyd
On Thu, 24 Feb 2022 at 14:11, Tim Düsterhus, WoltLab GmbH wrote: > > I see two possible options to remediate this issue: > > --- > > 1. Disallow both serialization and unserialization. > > This will make the serialization issue very obvious, but will require > adjustments to exception

[PHP-DEV] Proposal for RFC to remove undefined array index warning when used in a ternary

2022-02-26 Thread Robert Landers
Hello internals! There is a lot of code in existence that does something like this: $item['id'] ? [$item['id']] : $something_else which to dissolve the current warning must be changed to something like this: !empty($item['id']) ? [$item['id']] : $something_else However, if performance is an