Uh oh!
There was an error while loading. Please reload this page.
Remove randominess from spl_object_hash - #7010
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TysonAndre
commented
May 20, 2021
LGTM as the author of the spl_object_id PR Aside: As nikic said,
I think deprecating spl_object_hash makes sense - it's much worse than spl_object_id for memory usage and time. Support for php 7.2 was dropped recently, and 7.2 was the version that introduced spl_object_id. At the time I was looking at it years ago, I wasn't sure if php allowed having two objects share the same handle but different handlers - I asked Nikita a few months ago and php doesn't allow this, so spl_object_hash isn't providing anything useful with the handlers hash |
see https://3v4l.org/b4Z1G and https://github.com/php/php-src/blob/php-8.0.6/ext/spl/php_spl.c#L644-L670
related with #2611
Unneeded randominess is not good as output of repeated runs of php scripts can differ.
I think
spl_object_hashshould be even deprecated in favor ofspl_object_id.