Extract stubs from PHP 8.6 - #163
Conversation
|
Why do we need properties and enum cases? PHPStan will not make use of this information in my opinion. It's just more things to parse. Also I don't understand why the diff moves stuff around. For example for DateTime.php, there's: We should work on so that the order is stable. If you want to order things first as a preparatory PR (while still going up to only 8.5), that'd be okay if it'd help make the diff cleaner and help us understand what really changes for PHP 8.6. |
|
You are right about properties and enum cases, and I checked rather than argue. One consequence to confirm: without it, the 8.5 to 8.6 run deletes members that are in the stubs today, in The orderingFound it, and it explains your
$newStmtsToSet = $untouchedStmts; // everything outside the current version window
foreach ($newMethods as $stmt) { ... }
foreach ($newConstants as $stmt) { ... }So the body is rebuilt by category, not in source order, and whatever is outside the window is written
It follows that the churn grows at each version step, because more members age out of the window each time. I will send the preparatory PR you offered, still going up to 8.5 only. It keeps the body in source order |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1293b12 to
6e77145
Compare
|
Rebased on the reorder, so the 8.6 diff has no reordering left in it: 82 modified files and 71 new stubs. I dropped the extractor change that kept properties and enum cases, as you asked. Seven files lose members The only extractor change left is the parser one. php-src master uses asymmetric visibility in the dom |
Adds a PHP 8.6 extraction step, and fixes what that step exposed in the extractor.
8.6 has no branch of its own in php-src yet, so the step checks out
master. It reportsPHP_VERSION "8.6.0-dev"today.The extractor drops properties and enum cases
The class merge in
compareStatements()collectsClassMethodandClassConstfrom the old statementsand puts them back.
PropertyandEnumCaseare collected by neither, so they are lost whenever a classcarries them.
Untagged members go into
$oldStmts, which only methods and constants are read back out of. Members thatalready carry
#[\Since]land in$untouchedStmtsand survive, which is why this has stayed invisible.Running 8.5 to 8.6 without the fix loses real members, all of which are unchanged in php-src
master:Uri/WhatWg/UrlValidationErrorTypeUri/WhatWg/UrlValidationErrorUri/UriComparisonModeUri/WhatWg/InvalidUrlExceptionpublic readonly array $errorsZend/NoDiscardpublic readonly ?string $messageext/curl/CurlSharePersistentHandlepublic readonly array $optionsThe fix mirrors the constants path. A member missing from the old version gets
#[\Since], and memberskeep their place above the methods.
The diff after the fix
I ran the extraction locally against php-src
masterto see it before CI does:ext/spl/DirectoryIterator, and that one is a PHPDoc reformat:/** @return int|false */becomes a block with@tentative-return-typeand@return (int | false).Before the extractor fix the same run produced 7 files with net deletions. After it, none that lose a
member.
Checked afterwards:
UrlValidationErrorTypehas the same 29 cases asmaster, andNoDiscardkeeps itsproperty.
No stubs are committed here, since the workflow commits those itself on
main.