PharFileInfo::__construct Phar エントリオブジェクトを作成する &reftitle.description; public PharFileInfo::__construct stringfilename これは直接コールしてはいけません。PharFileInfo オブジェクトを作成するには、 配列へのアクセスを通じて Phar::offsetGet をコールします。 &reftitle.parameters; filename ファイルを取得するための完全な url。 ファイル my/file.php の情報を phar boo.phar から取得したい場合は、 このエントリは phar://boo.phar/my/file.php となります。 &reftitle.errors; __construct() が二度コールされた場合に BadMethodCallException、 phar の URL がおかしかったり phar がオープンできなかったり、 あるいはファイルが phar 内で見つからなかった場合に UnexpectedValueException がスローされます。 &reftitle.examples; <function>PharFileInfo::__construct</function> の例 $text) { echo "行番号 $line: $text"; } // これも動作します $file = new PharFileInfo('phar:///path/to/my.phar/testfile.txt'); foreach ($file as $line => $text) { echo "行番号 $line: $text"; } } catch (Exception $e) { echo 'Phar 操作に失敗しました: ', $e; } ?> ]]> &example.outputs;