codesamplex

サンプル

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

sha256:2f575c0da5b071e88ac0a9aa7da2b69d3752b2625239ad080bbacd6225817b77

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Prove that ParserFactory::createForVersion expects a PhpVersion object, not legacy integer kind constants. HOW
パッケージ
nikic/php-parser 5.8.0
環境
php
作成日
2026-08-16T12:17:31Z

よくある思い込み

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

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート