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