Skip to content

Add initial support for PHP 8.7 - #756

Closed
mbeccati wants to merge 2 commits into
thecodingmachine:masterfrom
mbeccati:master
Closed

mbeccati wants to merge 2 commits into
thecodingmachine:masterfrom
mbeccati:master

Conversation

@mbeccati

Copy link
Copy Markdown
Contributor

8.6 has been branched out and master became 8.7

Comment thread generator/src/Commands/GenerateCommand.php Outdated
Safe\preg_split accepts a null limit for compatibility, but passing it to native preg_split deprecates the call on supported PHP versions. Normalize null to -1, preserving unlimited splitting, and generate that behavior consistently. Add a generator regression test.
@mbeccati

mbeccati commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

I've asked codex to help me understand the failures.

The failures had two separate causes: the generated loaders lacked PHP 8.7 branches, and the historical doc-en snapshots depended on XML entities removed from the current doc-base.

The generator now pins a compatible [doc-en, doc-base] tuple for each PHP version, so that checkouts work fine.

The second commit also fixes a deprecation in Safe\preg_split() by normalizing null to -1, preserving unlimited splitting, with a generator regression test.

Verified locally on recent PHP 8.6 and 8.7 snapshots: all 46 library tests and 41 generator tests pass on both versions.

@shish

shish commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

I've manually merged the php 8.7 parts - for the preg_split, where are you seeing that problem? Adding a special case for one particular function in the middle of code generation works but feels like fixing a symptom, so I'd like to investigate that deeper to see if there's another root cause that might also be affecting other functions 🤔

@shish

shish commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Ah, I see that deprecation warning - reading the PR which introduced it, it seems to be intentional (it verifies that if PHP allows passing a deprecated parameter, then Safe should allow passing the same deprecated parameter, so that we retain compatibility)

@shish shish closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants