Skip to content

Commit d5c854d

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Improve file/line information for narrowing warning
2 parents eb97b09 + 323f3c6 commit d5c854d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,10 @@ static void emit_type_narrowing_warning(const zend_op_array *op_array, zend_ssa
18581858
int def_op_num = ssa->vars[var].definition;
18591859
const zend_op *def_opline = def_op_num >= 0 ? &op_array->opcodes[def_op_num] : NULL;
18601860
const char *def_op_name = def_opline ? zend_get_opcode_name(def_opline->opcode) : "PHI";
1861-
zend_error(E_WARNING, "Narrowing occurred during type inference of %s. Please file a bug report on bugs.php.net", def_op_name);
1861+
uint32_t lineno = def_opline ? def_opline->lineno : 0;
1862+
zend_error_at(
1863+
E_WARNING, op_array->filename, lineno,
1864+
"Narrowing occurred during type inference of %s. Please file a bug report on https://github.com/php/php-src/issues", def_op_name);
18621865
}
18631866

18641867
ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv)

0 commit comments

Comments
 (0)