Please note that since PHP 7.2 there's new function available spl_object_id() which returns int instead of string. It's (supposed to be) more performant. Due to lack of documentation I recommend you reading the PR https://github.com/php/php-src/pull/2611