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

Handle references in keys of StrictHashSet/StrictHashMap #198

Open
TysonAndre opened this issue Nov 2, 2022 · 0 comments
Open

Handle references in keys of StrictHashSet/StrictHashMap #198

TysonAndre opened this issue Nov 2, 2022 · 0 comments

Comments

@TysonAndre
Copy link
Owner

  • If arrays contain references, then use copies of the arrays that don't contain references, instead (and use copies for parents of those arrays, as well). If there are multiple occurrences of the original array then use the same copy every time.
  • Alternately, throw a RuntimeException (e.g. for reference cycles)
$x = new Teds\StrictHashSet();
$v = 1;
$a = [&$v];
$x->add($a); // should add a copy of the array without references, instead
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

No branches or pull requests

1 participant