krakjoe / cmark

CommonMark for PHP
Other
46 stars 7 forks source link

PHP 8.0 compatibility #21

Open anthonyryan1 opened 3 years ago

anthonyryan1 commented 3 years ago

It compiles against PHP 8.0 but it's failing to allow php-fpm to start.

PHP Fatal error:  Class CommonMark\Node must implement interface Traversable as part of either Iterator or IteratorAggregate

Some of the other modules I interact with have used this release as a chance to switch to stub files (compiled with php-src/build/gen_stub.php) to automatically compile the function headers.

Should we follow suit on that? Or keep things as is as much as possible and only implement Traversable support.

dseguy commented 2 years ago

same error with 8.1. works well with 7.4.

dwo0 commented 2 years ago

I just put in a pull request to get the extension working past 8.0. I’ve tested it on 7.4, 8.0 and 8.1, and they all seem to work.

EvgenyLin commented 1 year ago

after Installing extension=cmark.so PHP doesn't start:

PHP Fatal error: Class CommonMark\Node must implement interface Traversable as part of either Iterator or IteratorAggregate in Unknown on line 0

PHP 8.1.13 (cli) (built: Nov 26 2022 14:07:36) (NTS)

anthonyryan1 commented 1 year ago

@krakjoe @remicollet @weltling

Sorry to highlight all of you, but this extension is effectively dead. The currently released version is not compatible with any supported PHP version at this time.

There are open pull requests to fix compatibility. If one of you could take the time to review them, we can get this extension alive again. Otherwise it's dead without someone forking it.

dwo0 commented 1 year ago

The pull request that I submitted passed all tests with 8.0 and 8.1, but some tests failed with 8.2 and the 8.3 release candidate. I was able to fix most of them with some minor adjustments to the expected output, but one test (./Node/Abstract/027.phpt) is still failing, and fixing it is beyond what I’m capable of. If anyone could look at it, I would appreciate it deeply.

macintoshplus commented 2 months ago

@anthonyryan1 @dwo0 You can download the DDL with patch for PHP 8 here: https://phpext.phptools.online/extension/text/cmark-360