1--TEST--
2BcMath\Number pow(): negative power of zero
3--EXTENSIONS--
4bcmath
5--FILE--
6<?php
7
8$values = [0, '0'];
9
10$exponents = [
11    [-3, 'int'],
12    ['-2', 'string'],
13    [new BcMath\Number('-2'), 'object'],
14];
15
16foreach ($values as $value) {
17    $num = new BcMath\Number($value);
18
19    foreach ($exponents as [$exponent, $type]) {
20        echo "{$value} ** {$exponent}: {$type}\n";
21        try {
22            $num->pow($exponent);
23        } catch (Error $e) {
24            echo $e->getMessage() . "\n";
25        }
26    }
27}
28?>
29--EXPECT--
300 ** -3: int
31Negative power of zero
320 ** -2: string
33Negative power of zero
340 ** -2: object
35Negative power of zero
360 ** -3: int
37Negative power of zero
380 ** -2: string
39Negative power of zero
400 ** -2: object
41Negative power of zero
42