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--EXPECTF-- 42int(0) 43 44Exception: Bit shift by negative number 45int(0) 46 47Exception: Bit shift by negative number 48 49Exception: Modulo by zero 50int(0) 51