Inconsistent use of E_WARNING and E_COMPILE_WARNING in zend_compile.c
未关闭
还没有人认领这个 Issue。
Bug
Status: Needs Triage
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.1k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
Description
The following code:
<?php
set_error_handler(function (int $errno, string $errstr) {
var_dump($errno, $errstr);
}, E_ALL);
include('test7.php');
and
<?php
use Foo;
function foo(integer $foo) {
}
Resulted in this output:
int(2)
string(60) "The use statement with non-compound name 'Foo' has no effect"
Warning: "integer" will be interpreted as a class name. Did you mean "int"? Write "\integer" to suppress this warning in php-src/test7.php on line 5
But I expected this output instead:
Warning: The use statement with non-compound name 'Foo' has no effect in php-src/test7.php on line 3
Warning: "integer" will be interpreted as a class name. Did you mean "int"? Write "\integer" to suppress this warning in php-src/test7.php on line 5
or
int(2)
string(60) "The use statement with non-compound name 'Foo' has no effect"
int(2)
string(108) ""integer" will be interpreted as a class name. Did you mean "int"? Write "\integer" to suppress this warning"
The same applies to other warnings emitted during compilation.
PHP Version
git master
Operating System
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用 test7.php 重现两个警告示例,然后检查 zend_compile.c 中的警告发出路径。比较非复合使用警告和 integer 类型警告的报告方式,并验证编译警告始终一致地使用预期的错误处理器行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c, php
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100