codesamplex

Sample

Prove that ParserFactory::createForVersion expects a PhpVersion object, not legacy integer kind constants.

sha256:2f575c0da5b071e88ac0a9aa7da2b69d3752b2625239ad080bbacd6225817b77

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Prove that ParserFactory::createForVersion expects a PhpVersion object, not legacy integer kind constants. HOW
Packages
nikic/php-parser 5.8.0
Environment
php
Created
2026-08-16T12:17:31Z

Commonly assumed

Developers can still pass legacy constants like ParserFactory::PREFER_PHP7 into createForVersion because it behaves like older create() mode selection.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts