Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect $dontVersionFields when versioning attributes #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jez500
Copy link

@jez500 jez500 commented Aug 30, 2021

This both respects dontVersionFields and provides the ability to override what fields are getting versioned

*
* @return array
*/
public function arrayDiffAssocRecursive($array1, $array2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jez500 - have you tested this for performance changes? Is this slower, the same, faster?

Also, is this adding recursivity, which this didn't have before?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nonoesp

This will certainly be slower than the native php functions, but it is also doing more and doesn't cause a fatal error if a property is not a string (eg json fields). That said I have noticed no notable difference in performance with my testing.

Recursively is likely unavoidable with nested arrays, but will only kick in if there are actually nested arrays.

@nonoesp
Copy link
Collaborator

nonoesp commented Sep 2, 2021

Thanks for the pull request! @jez500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants