1--TEST-- 2BcMath\Number mod by zero by operator 3--EXTENSIONS-- 4bcmath 5--FILE-- 6<?php 7$num = new BcMath\Number(100); 8 9try { 10 $num % 0; 11} catch (Error $e) { 12 echo $e->getMessage() . "\n"; 13} 14 15try { 16 $num % '0'; 17} catch (Error $e) { 18 echo $e->getMessage() . "\n"; 19} 20 21try { 22 $num % (new BcMath\Number(0)); 23} catch (Error $e) { 24 echo $e->getMessage() . "\n"; 25} 26 27$zero = new BcMath\Number(0); 28 29try { 30 100 % $zero; 31} catch (Error $e) { 32 echo $e->getMessage() . "\n"; 33} 34 35try { 36 '100' % $zero; 37} catch (Error $e) { 38 echo $e->getMessage() . "\n"; 39} 40 41try { 42 $num % $zero; 43} catch (Error $e) { 44 echo $e->getMessage() . "\n"; 45} 46?> 47--EXPECT-- 48Modulo by zero 49Modulo by zero 50Modulo by zero 51Modulo by zero 52Modulo by zero 53Modulo by zero 54