Add PHP 8.4 support in a PHP >= 5.1 compatible way#900
Add PHP 8.4 support in a PHP >= 5.1 compatible way#900dregad wants to merge 3 commits intoerusev:1.7.xfrom
Conversation
Changing the $Block parameter's default value from null to array() caused the PHPUnit tests to fail with "Argument erusev#2 ($Block) must be of type array, null given". Initializing $CurrentBlock variable in lines() method to array() instead of null, and change subsequent tests from isset() to !empty(). Also change blockCode() method signature, which was missed in previous commit.
|
🟢 Build is passing for all PHP versions now I'm not sure why the workflow is running on my fork and not here though, is that normal ? |
| # Setext | ||
|
|
||
| protected function blockSetextHeader($Line, array $Block = null) | ||
| protected function blockSetextHeader($Line, array $Block = array()) |
There was a problem hiding this comment.
This is a BC break as the method can no longer be called with null as the second argument anymore.
| # Table | ||
|
|
||
| protected function blockTable($Line, array $Block = null) | ||
| protected function blockTable($Line, array $Block = array()) |
|
@xabbuh you're absolutely right, I am well aware of that. BUT:
As an added side benefit, we have stronger typing (array instead of array|null). For SemVer compliance, considering that a protected function is technically not a public API:
I believe this could be released as 1.8.0, with a clear message in the release notes. I am willing to draft it if you want. In any case, there is absolutely no way to fix 8.4 compatibility without some minor BC break, so if you disagree with my proposal, at least take your pick from one of the alternatives:
Status quo is not an option. |
|
Regarding the 2.0.0 release: Is there anything that needs help / a plan going forward so that this could be an option too? |
|
@erusev could this please be merged, and a new version released ? Let me know if I can help. |
|
What are we waiting for? |
|
These changes are easy for us to adopt in extensions, so I see no issue here |
|
I have to ask tho, why 5.1? supporting anything below 7.4 should not be a thing |
IIRC at some point someone requested that there should be no BC break in 1.7.x hotfix hence not changing the PHP compatibility. But I agree that in 2025 it doesn't make much sense. |
PR erusev#900 Also Closes / invalidates (redundant with) the following PRs: - erusev#899 - erusev#924
|
Parsedown 1.7.5 with PHP 8.4/8.5 compatibility was released in the parsedown/parsedown fork (implementing this PR). |
I believe mine is the better approach for the 1.7.x branch (which still officially supports PHP 5.3 and later) as it maintains backwards-compatibility for anyone still using PHP < 7.1.
I hope this can be merged quickly, and a new release tagged. Thanks in advance, and let me know if there is anything else I can do to speed that up.