]> granicus.if.org Git - php/commitdiff
Fixed bug #76501 (Funny message with fatal error)
authorKalle Sommer Nielsen <kalle@php.net>
Wed, 4 Jul 2018 01:04:31 +0000 (03:04 +0200)
committerKalle Sommer Nielsen <kalle@php.net>
Wed, 4 Jul 2018 01:04:31 +0000 (03:04 +0200)
Zend/tests/break_error_001.phpt
Zend/tests/break_error_002.phpt
Zend/zend_compile.c

index eb8ce2efef715fe2c18551660b46ca66a5aff8ca..d823f5056329e04b33aa7e3bd02da6172572c8cf 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-'break' error (non positive numbers)
+'break' error (non positive integers)
 --FILE--
 <?php
 function foo () {
@@ -7,4 +7,4 @@ function foo () {
 }
 ?>
 --EXPECTF--
-Fatal error: 'break' operator accepts only positive numbers in %sbreak_error_001.php on line 3
+Fatal error: 'break' operator accepts only positive integers in %sbreak_error_001.php on line 3
index a1c172d19865c1768cbaf601846ba559f01ae0dd..e78fd7594e18d280409daa695886367f900ed5f0 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-'break' error (operator with non-constant operand)
+'break' error (operator with non-integer operand)
 --FILE--
 <?php
 function foo () {
@@ -7,4 +7,4 @@ function foo () {
 }
 ?>
 --EXPECTF--
-Fatal error: 'break' operator with non-constant operand is no longer supported in %sbreak_error_002.php on line 3
+Fatal error: 'break' operator with non-integer operand is no longer supported in %sbreak_error_002.php on line 3
index 8ee9caf73d8871cdd70f6b33d789c72e8d37f0ff..602d639f252b798a56e99e5865e85c4822d8f4e8 100644 (file)
@@ -4560,13 +4560,13 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
        if (depth_ast) {
                zval *depth_zv;
                if (depth_ast->kind != ZEND_AST_ZVAL) {
-                       zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-constant operand "
+                       zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-integer operand "
                                "is no longer supported", ast->kind == ZEND_AST_BREAK ? "break" : "continue");
                }
 
                depth_zv = zend_ast_get_zval(depth_ast);
                if (Z_TYPE_P(depth_zv) != IS_LONG || Z_LVAL_P(depth_zv) < 1) {
-                       zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers",
+                       zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive integers",
                                ast->kind == ZEND_AST_BREAK ? "break" : "continue");
                }