1--TEST--
2Error cases of compound shift assignment on strings
3--FILE--
4<?php
5
6$n = "65";
7$n <<= $n;
8var_dump($n);
9
10$n = "-1";
11try {
12    $n <<= $n;
13    var_dump($n);
14} catch (ArithmeticError $e) {
15    echo "\nException: " . $e->getMessage() . "\n";
16}
17
18$n = "65";
19$n >>= $n;
20var_dump($n);
21
22$n = "-1";
23try {
24  $n >>= $n;
25  var_dump($n);
26} catch (ArithmeticError $e) {
27    echo "\nException: " . $e->getMessage() . "\n";
28}
29
30$n = "0";
31try{
32  $n %= $n;
33  var_dump($n);
34} catch (DivisionByZeroError $e) {
35    echo "\nException: " . $e->getMessage() . "\n";
36}
37
38$n = "-1";
39$n %= $n;
40var_dump($n);
41?>
42--EXPECT--
43int(0)
44
45Exception: Bit shift by negative number
46int(0)
47
48Exception: Bit shift by negative number
49
50Exception: Modulo by zero
51int(0)
52