yield without value in reference generator function does not create notice
オープン
まだ誰も着手していません。
Bug
Category: Generators
Status: Verified
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
The following code:
<?php
error_reporting(E_ALL);
function &y()
{
yield null; // warning
yield; // no warning
}
foreach (y() as &$y);
Resulted in this output:
PHP Notice: Only variable references should be yielded by reference in /home/user10/test.php on line 5
But I expected this output instead:
PHP Notice: Only variable references should be yielded by reference in /home/user10/test.php on line 5
PHP Notice: Only variable references should be yielded by reference in /home/user10/test.php on line 6
PHP Version
PHP 8.2.24 (cli) (built: Sep 27 2024 04:16:10) (NTS)
Operating System
Debian GNU/Linux 12 (bookworm)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、E_ALLを有効にしたPHP 8.2.24でリファレンスジェネレーターの例を再現し、その後、2つのyield形式がどのように処理されるかを追跡します。値なしのyieldがyield nullと同じnoticeを出力し、両方の行に対する回帰テストのカバレッジがあることを完了条件とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100