Hi
On 15.05.24 16:52, Joshua Rüsweg wrote:
I've just opened the vote for the "array_find" RFC.
The RFC contains two votes, each of which requires a 2/3 majority.
Voting runs until 2024-05-29 15:00 UTC.
Please find the below resources for your reference:
RFC: https://w
entation: https://github.com/php/php-src/pull/14108
Discussion Thread: https://externals.io/message/123015
Cheers
Joshua Rüsweg
2/3 majority for the functions to be implemented.
Cheers
Joshua Rüsweg
Hi
On 02.05.24 15:27, Larry Garfield wrote:
It's not just that it errors confusingly. It's that the design as is would be
incompatible with any C-based function. A function that works with anything
*except* the standard library seems... problematic.
It's possible that, since these new funct
Hi
On 01.05.24 12:26, Larry Garfield wrote:
This looks good to me, with one remaining exception, which isn't specific to
this function but should still be discussed: Always passing the value and key
to the callback is unsafe, for two reasons.
1. If the callback is an internal function rather
Hi
On 19.04.24 23:29, Tim Düsterhus wrote:> Thinking about this: I believe
that it would make sense to bundle
array_any and array_every (or array_all, see below) within the same RFC
due to the similarity. It can be a separate vote for those two, but
having the option of getting all three would
Hi
On 23.04.24 22:22, Levi Morrison wrote:
The RFC looks better to me. The
[Unaffected PHP Functionality][1] section looks like it needs
updating, though:
This RFC only adds two new functions and an enum to PHP and
only affects previously defined functions which are named as
the proposed funct
Hi
On 19.04.24 21:20, Joshua Rüsweg wrote:
I definitely see the point where there is an advantage to having two
separate methods and can definitely understand that it is easier for
developers to understand the control flow without evaluating the
parameters.
I'm unsure if that
Hi
On 19.04.24 23:17, Tim Düsterhus wrote:
On 4/19/24 22:08, Larry Garfield wrote:
There's another issue, though: Will the callback always be given both
$value and $key?
The current implementation always passes both, which, as I just learned,
is inconsistent with `array_filter` which has th
Hi
On 10.04.24 00:12, Larry Garfield wrote:
Another alternative is to always return the key, because you can trivially get
the value from the key, but not vice versa. Of course, the resulting syntax
for that is frequently fugly.
$val = $array[array_find($db, $array)] ?? some-default;
In 9
On 11.04.24 03:03, Levi Morrison wrote:
IMO, it's better to separate it into two functions because its type is
stable without control flow. For instance:
// Returns K if $b is true, V otherwise.
function array_find(
array $array,
callable(V, K): bool $callback,
turn-mode Enum would make more sense here.
I like the idea, thank you! However, I am unsure whether an additional
enum for the function would not be too much overhead.
Cheers
Joshua Rüsweg
.
You can find the RFC at:
https://wiki.php.net/rfc/array_find
Proof of concept implementation is in:
https://github.com/joshuaruesweg/php-src/commit/9f3fc252b92f534d498e5f1e6a463e15f45da208
I'm looking forward to your feedback.
Cheers
Joshua Rüsweg
concludes.
Cheers
Joshua Rüsweg
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
From` sounds incomplete to me. `getBytesFromList`
sounds to me as if an array is being passed there and not a string.
`getBytesFromString` sounds good to me, though. Better than
`getBytesfromAlphabet`!
Cheers
Joshua Rüsweg
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
the getFloat method with a parameter that
specifies which type of interval should be generated (Open, Closed,
Right Half-Open and Left Half-Open).
Are you happy with the enum names? Have you any other suggestions?
Cheers
Joshua Rüsweg
--
PHP Internals - PHP Runtime Development Mailing List
To
not done and it only causes confusion if any
functions are introduced after the feature freeze. In the end, however,
I think it is the release manager who decides.
Cheers
Joshua Rüsweg
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
parameter? Enum?
We're looking forward to your feedback.
Cheers
Joshua Rüsweg
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
/php/php-src/pull/9664
[3] https://github.com/php/php-src/pull/9679
PS: Since this is my first contribution, someone needs to give me karma
to open an RFC. My account name is `josh`.
Cheers
Joshua Rüsweg
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www
19 matches
Mail list logo