Skip to content

Commit c49f0fd

Browse files
committed
Fixed bug #76501 (Funny message with fatal error)
1 parent 2edf94a commit c49f0fd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Zend/tests/break_error_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
--TEST--
2-
'break' error (non positive numbers)
2+
'break' error (non positive integers)
33
--FILE--
44
<?php
55
function foo () {
66
break 0;
77
}
88
?>
99
--EXPECTF--
10-
Fatal error: 'break' operator accepts only positive numbers in %sbreak_error_001.php on line 3
10+
Fatal error: 'break' operator accepts only positive integers in %sbreak_error_001.php on line 3

Zend/tests/break_error_002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
--TEST--
2-
'break' error (operator with non-constant operand)
2+
'break' error (operator with non-integer operand)
33
--FILE--
44
<?php
55
function foo () {
66
break $x;
77
}
88
?>
99
--EXPECTF--
10-
Fatal error: 'break' operator with non-constant operand is no longer supported in %sbreak_error_002.php on line 3
10+
Fatal error: 'break' operator with non-integer operand is no longer supported in %sbreak_error_002.php on line 3

Zend/zend_compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4560,13 +4560,13 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
45604560
if (depth_ast) {
45614561
zval *depth_zv;
45624562
if (depth_ast->kind != ZEND_AST_ZVAL) {
4563-
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-constant operand "
4563+
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-integer operand "
45644564
"is no longer supported", ast->kind == ZEND_AST_BREAK ? "break" : "continue");
45654565
}
45664566

45674567
depth_zv = zend_ast_get_zval(depth_ast);
45684568
if (Z_TYPE_P(depth_zv) != IS_LONG || Z_LVAL_P(depth_zv) < 1) {
4569-
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers",
4569+
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive integers",
45704570
ast->kind == ZEND_AST_BREAK ? "break" : "continue");
45714571
}
45724572

0 commit comments

Comments
 (0)