You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PHP it's possible to implement a custom array class, by implementing the ArrayAccess interface. That way you can use any instance of your class as be it an array. We had our own implementation of pluck which could handle elements that did this. But underscore's pluck doesn't seem to be able to handle these custom array types.
The line from our own implementation that checked for keys existence in elements, was:
if (isset($element[$key])) { // Must use isset instead of array_key_exists, because the latter does not work correctly on self implementing ArrayAccess classes.
Note the comment.
It would be great if underscore would support this too. We'd rather use your pluck version than our own.
The text was updated successfully, but these errors were encountered:
In PHP it's possible to implement a custom array class, by implementing the ArrayAccess interface. That way you can use any instance of your class as be it an array. We had our own implementation of pluck which could handle elements that did this. But underscore's pluck doesn't seem to be able to handle these custom array types.
The line from our own implementation that checked for keys existence in elements, was:
Note the comment.
It would be great if underscore would support this too. We'd rather use your pluck version than our own.
The text was updated successfully, but these errors were encountered: