xref: /PHP-8.0/Zend/tests/pow_array_leak.phpt (revision cdaf3503)
1--TEST--
2Memory leak on ** with result==op1 array
3--FILE--
4<?php
5
6$x = [0];
7try {
8    $x **= 1;
9} catch (Error $e) {
10    echo $e->getMessage(), "\n";
11}
12var_dump($x);
13
14$x = [0];
15try {
16    $x **= $x;
17} catch (Error $e) {
18    echo $e->getMessage(), "\n";
19}
20var_dump($x);
21
22?>
23--EXPECT--
24Unsupported operand types: array ** int
25array(1) {
26  [0]=>
27  int(0)
28}
29Unsupported operand types: array ** array
30array(1) {
31  [0]=>
32  int(0)
33}
34