File size: 557 Bytes
1e94262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--TEST--
bcdiv — Divide two arbitrary precision numbers
--CREDITS--
TestFest2009
Antoni Torrents
antoni@solucionsinternet.com
--EXTENSIONS--
bcmath
--FILE--
<?php
try {
    bcdiv('10.99', '0');
} catch (DivisionByZeroError $ex) {
    echo $ex->getMessage(), PHP_EOL;
}

try {
    bcdiv('10.99', '0.00');
} catch (DivisionByZeroError $ex) {
    echo $ex->getMessage(), PHP_EOL;
}

try {
    bcdiv('10.99', '-0.00');
} catch (DivisionByZeroError $ex) {
    echo $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Division by zero
Division by zero
Division by zero