1--TEST--
2GMP operator overloading does not support []
3--EXTENSIONS--
4gmp
5--FILE--
6<?php
7
8$num = gmp_init(42);
9
10try {
11    var_dump($num + []);
12} catch (Throwable $e) {
13    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
14}
15
16try {
17    var_dump($num - []);
18} catch (Throwable $e) {
19    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
20}
21
22try {
23    var_dump($num * []);
24} catch (Throwable $e) {
25    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
26}
27
28try {
29    var_dump($num / []);
30} catch (Throwable $e) {
31    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
32}
33
34try {
35    var_dump($num % []);
36} catch (Throwable $e) {
37    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
38}
39
40try {
41    var_dump($num ** []);
42} catch (Throwable $e) {
43    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
44}
45
46try {
47    var_dump($num | []);
48} catch (Throwable $e) {
49    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
50}
51try {
52    var_dump($num & []);
53} catch (Throwable $e) {
54    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
55}
56try {
57    var_dump($num ^ []);
58} catch (Throwable $e) {
59    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
60}
61try {
62    var_dump($num << []);
63} catch (Throwable $e) {
64    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
65}
66try {
67    var_dump($num >> []);
68} catch (Throwable $e) {
69    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
70}
71
72?>
73--EXPECT--
74TypeError: Number must be of type GMP|string|int, array given
75TypeError: Number must be of type GMP|string|int, array given
76TypeError: Number must be of type GMP|string|int, array given
77TypeError: Number must be of type GMP|string|int, array given
78TypeError: Number must be of type GMP|string|int, array given
79TypeError: Unsupported operand types: GMP ** array
80TypeError: Number must be of type GMP|string|int, array given
81TypeError: Number must be of type GMP|string|int, array given
82TypeError: Number must be of type GMP|string|int, array given
83TypeError: Unsupported operand types: GMP << array
84TypeError: Unsupported operand types: GMP >> array
85