scriptotek/php-marc

Problem with pear/File_MARC Extension and PHP 8.1

HagnMarkus opened this issue · 6 comments

Using the very old and unmaintained code of pear/File_MARC (v1.4.1 / 2019-11-13) now causes a problem with PHP 8.1:

During inheritance of SplDoublyLinkedList: Uncaught ErrorException: Return type of File_MARC_List::key() should either be compatible with SplDoublyLinkedList::key(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in pear\file_marc\File\MARC\List.php:96

Perhaps the code of pear/File_MARC can be taken directly into the php-marc module and refactored?

They (pear/File_MARC) have customized it!! Maybe change composer to dev-master?

The PR that solves this is in the pear/File_MARC dependency is at pear/File_MARC#19

@rudolfbyker So, maybe you (I saw some commits by you in this repo) can change the required package in the composer.json in the main branch (, like @HagnMarkus suggested)?

from: "pear/file_marc": "^1.4.1"
to: "pear/file_marc": "master@dev"

Currently I updated to PHP 8.3 and for me it seems impossible to use this fantastic library any longer. :(

BR

Update: I also saw that this project uses ck/file_marc_reference which IMHO don't seem to have code/a branch which is ready for PHP8. So it may a bit complicated situation here … :/

@sommer-gei I made PRs, but I did not merge. I don't think I have the access to do that. @danmichaelo performed the merges on all of my PRs.

@rudolfbyker So, maybe you (I saw some commits by you in this repo) can change the required package in the composer.json in the main branch (, like @HagnMarkus suggested)?

from: "pear/file_marc": "^1.4.1" to: "pear/file_marc": "master@dev"

Currently I updated to PHP 8.3 and for me it seems impossible to use this fantastic library any longer. :(

BR

Update: I also saw that this project uses ck/file_marc_reference which IMHO don't seem to have code/a branch which is ready for PHP8. So it may a bit complicated situation here … :/

Sorry for my unresponsiveness, @HagnMarkus and @sommer-gei! I updated to "pear/file_marc": "@dev" now and published a new major version (3.0.0). While there are a lot of deprecation warnings from ck/file_marc_reference, it seems like the package continues to work fine from what I can see.

@danmichaelo Thank you a lot for 3.0.0, it seems to work. :)