Re: [PHP-DEV] [RFC] Saner array_(sum|product)()

2023-02-20 Thread G. P. B.
On Mon, 20 Feb 2023 at 14:38, Andreas Hennings wrote: > Hello, > the RFC seems like a good idea to me. > However, I do not see any mention of plus operator on arrays, e.g. ['a' => > 'A'] + ['b' => 'B']. The array_reduce() would support this, but I think > array_sum() would not, because of the ret

Re: [PHP-DEV] [RFC] Saner array_(sum|product)()

2023-02-20 Thread Andreas Hennings
Hello, the RFC seems like a good idea to me. However, I do not see any mention of plus operator on arrays, e.g. ['a' => 'A'] + ['b' => 'B']. The array_reduce() would support this, but I think array_sum() would not, because of the return type. I just think this should be made more explicit. -- Andre

Re: [PHP-DEV] [RFC] Saner array_(sum|product)()

2023-02-12 Thread G. P. B.
Hello internals, If there are no further feedback I intend on opening the vote for this tomorrow. Best regards, George P. Banyard

Re: [PHP-DEV] [RFC] Saner array_(sum|product)()

2023-01-26 Thread G. P. B.
Hello internals, I've slightly updated the RFC: https://wiki.php.net/rfc/saner-array-sum-product I've added an FFI example which overloads addition but cannot be cast to a numeric type. And changed the behaviours around objects. An object needs to implement a numeric cast for it to be added/multi

Re: [PHP-DEV] [RFC] Saner array_(sum|product)()

2023-01-18 Thread G. P. B.
On Wed, 18 Jan 2023 at 15:06, Derick Rethans wrote: > On Tue, 17 Jan 2023, G. P. B. wrote: > > > I would like to start the discussion about the Saner > > array_(sum|product)() RFC: > > https://wiki.php.net/rfc/saner-array-sum-product > > > > Currently, the array_sum() and array_product() behave d

Re: [PHP-DEV] [RFC] Saner array_(sum|product)()

2023-01-18 Thread Derick Rethans
On Tue, 17 Jan 2023, G. P. B. wrote: > I would like to start the discussion about the Saner > array_(sum|product)() RFC: > https://wiki.php.net/rfc/saner-array-sum-product > > Currently, the array_sum() and array_product() behave differently than > their userland implementation as they ignore

[PHP-DEV] [RFC] Saner array_(sum|product)()

2023-01-17 Thread G. P. B.
Hello internals, I would like to start the discussion about the Saner array_(sum|product)() RFC: https://wiki.php.net/rfc/saner-array-sum-product Currently, the array_sum() and array_product() behave differently than their userland implementation as they ignore arrays and objects, and cast the re