User tests: Successful: Unsuccessful:
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Title |
|
Title |
|
Rel_Number | 0 | ⇒ | 10942 |
Relation Type | ⇒ | Pull Request for |
@bertmert because there is a native function I would depreciate the function, if we have a higher minimum PHP version it should go away. So I think a valid argument for using it is that we can identify the places where we have to replace code. For me not a great argument :-)
Why are we not using an array indexed by:
$redirect['old_url']
that points to object references of $redirect
and then use isset() ? it should be much faster
It looks like ArrayHelper::getColumn()
can deal with nested arrays while array_column()
is a single array only. I guess that's one reason to keep it but perhaps redo the internals to just use array_column()
.
/off-topic
Category | ⇒ | Plugins |
I don't have a good feeling to use an url as an index for an array.
i did not know that, i missed this,
do you have a link mentioning the dangers of it?
Understanding the PHP array implementation
the "index" , in our case url (string) will be hashed, and any collisions are handled with a linked list that holds the real "index" that was hashed
or do you mean something else ?
I see what you mean now,
any binary data can be used as index in PHP, hash function will just read bytes
In PHP, associative arrays are implemented as hashtables with some extra functions
[EDIT]
please anyone correct me here, if i am missing something
also this PR should work, (but i have not taken time to test it)
I assume that this can be closed as @eilsonge merged #10947 ??
Yes - I was in the middle of typing that :) I've gone with the polyfill as it's effectively making our code optimised and forwards compatible
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-06-27 21:35:24 |
Closed_By | ⇒ | wilsonge |
There's also an API function doing the same like array_column:
ArrayHelper::getColumn($redirects, 'old_url')