--TEST-- BcMath\Number div(), mod(), divmod() by zero --EXTENSIONS-- bcmath --FILE-- div($value2); echo "NG\n"; } catch (Error $e) { echo $e->getMessage() === 'Division by zero' ? 'OK' :'NG'; echo "\n"; } echo "mod: "; try { $num->mod($value2); echo "NG\n"; } catch (Error $e) { echo $e->getMessage() === 'Modulo by zero' ? 'OK' :'NG'; echo "\n"; } echo "divmod: "; try { $num->divmod($value2); echo "NG\n"; } catch (Error $e) { echo $e->getMessage() === 'Division by zero' ? 'OK' :'NG'; echo "\n"; } echo "\n"; } } ?> --EXPECT-- 100 and 0: int div: OK mod: OK divmod: OK 100 and 0: int div: OK mod: OK divmod: OK 100 and 0: string div: OK mod: OK divmod: OK 100 and -0: string div: OK mod: OK divmod: OK 100 and 0.000: string div: OK mod: OK divmod: OK 100 and -0.000: string div: OK mod: OK divmod: OK 100 and 0: object div: OK mod: OK divmod: OK 100 and 0: object div: OK mod: OK divmod: OK 100 and 0.000: object div: OK mod: OK divmod: OK 100 and 0.000: object div: OK mod: OK divmod: OK -100 and 0: int div: OK mod: OK divmod: OK -100 and 0: int div: OK mod: OK divmod: OK -100 and 0: string div: OK mod: OK divmod: OK -100 and -0: string div: OK mod: OK divmod: OK -100 and 0.000: string div: OK mod: OK divmod: OK -100 and -0.000: string div: OK mod: OK divmod: OK -100 and 0: object div: OK mod: OK divmod: OK -100 and 0: object div: OK mod: OK divmod: OK -100 and 0.000: object div: OK mod: OK divmod: OK -100 and 0.000: object div: OK mod: OK divmod: OK