mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Unary minus const expression consistency
This commit is contained in:
commit
ed80a7e8c9
3 changed files with 21 additions and 2 deletions
3
NEWS
3
NEWS
|
@ -2,6 +2,9 @@ PHP NEWS
|
||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||
?? ??? ????, PHP 8.2.6
|
?? ??? ????, PHP 8.2.6
|
||||||
|
|
||||||
|
- Core:
|
||||||
|
. Fix inconsistent float negation in constant expressions. (ilutov)
|
||||||
|
|
||||||
- DOM:
|
- DOM:
|
||||||
. Fixed bug #80602 (Segfault when using DOMChildNode::before()).
|
. Fixed bug #80602 (Segfault when using DOMChildNode::before()).
|
||||||
(Nathan Freeman)
|
(Nathan Freeman)
|
||||||
|
|
16
Zend/tests/unary_minus_const_expr_consistency.phpt
Normal file
16
Zend/tests/unary_minus_const_expr_consistency.phpt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--TEST--
|
||||||
|
Unary minus constant expression consistency
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
const ZERO = 0.0;
|
||||||
|
const MINUS_ZERO = -ZERO;
|
||||||
|
$minus_zero = -ZERO;
|
||||||
|
|
||||||
|
var_dump(MINUS_ZERO);
|
||||||
|
var_dump($minus_zero);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
float(-0)
|
||||||
|
float(-0)
|
|
@ -676,8 +676,8 @@ static zend_result ZEND_FASTCALL zend_ast_evaluate_ex(zval *result, zend_ast *as
|
||||||
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[0], scope) != SUCCESS)) {
|
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[0], scope) != SUCCESS)) {
|
||||||
ret = FAILURE;
|
ret = FAILURE;
|
||||||
} else {
|
} else {
|
||||||
ZVAL_LONG(&op1, 0);
|
ZVAL_LONG(&op1, -1);
|
||||||
ret = sub_function(result, &op1, &op2);
|
ret = mul_function(result, &op1, &op2);
|
||||||
zval_ptr_dtor_nogc(&op2);
|
zval_ptr_dtor_nogc(&op2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue