Skip to content

Commit 0172714

Browse files
committed
Fix spl_object_hash deprecation on PHP 8.6
When testing with PHP 8.6.0beta2, I get the following deprecation warning: Function spl_object_hash() is deprecated since 8.6, consider using spl_object_id() instead Let’s switch to the suggested function where supported. https://www.php.net/manual/en/function.spl-object-hash.php https://www.php.net/manual/en/function.spl-object-id.php
1 parent c6288bc commit 0172714

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Smalot/PdfParser/PDFObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,6 @@ public static function factory(
12101210
*/
12111211
protected function getUniqueId(): string
12121212
{
1213-
return spl_object_hash($this);
1213+
return \PHP_VERSION_ID < 70200 ? \spl_object_hash($this) : (string) \spl_object_id($this);
12141214
}
12151215
}

0 commit comments

Comments
 (0)