mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Fix ** operator with references
This commit is contained in:
parent
ff72c7bfd7
commit
4ee14c6f8d
17
Zend/tests/pow_ref.phpt
Normal file
17
Zend/tests/pow_ref.phpt
Normal file
@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Use power operator on reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 2;
|
||||
$b = 3;
|
||||
|
||||
$ref =& $b;
|
||||
|
||||
$a **= $b;
|
||||
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(8)
|
@ -1137,7 +1137,11 @@ ZEND_API int pow_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
|
||||
return SUCCESS;
|
||||
|
||||
default:
|
||||
if (!converted) {
|
||||
if (Z_ISREF_P(op1)) {
|
||||
op1 = Z_REFVAL_P(op1);
|
||||
} else if (Z_ISREF_P(op2)) {
|
||||
op2 = Z_REFVAL_P(op2);
|
||||
} else if (!converted) {
|
||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_POW);
|
||||
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
|
Loading…
Reference in New Issue
Block a user