php-src/Zend/tests/pow_array_leak.phpt
Nikita Popov cdaf35033d Improve "unsupported operands" error
By mentioning the operand types. We can do that now, as the
original operand types now remain available.

Closes GH-5330.
2020-04-01 11:26:43 +02:00

34 lines
425 B
PHP

--TEST--
Memory leak on ** with result==op1 array
--FILE--
<?php
$x = [0];
try {
$x **= 1;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($x);
$x = [0];
try {
$x **= $x;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($x);
?>
--EXPECT--
Unsupported operand types: array ** int
array(1) {
[0]=>
int(0)
}
Unsupported operand types: array ** array
array(1) {
[0]=>
int(0)
}