| 1 | <?php |
||
| 18 | class ErrorDemo |
||
| 19 | { |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Some old method that is used by system in production, but shouldn't be used for the new code |
||
| 23 | * |
||
| 24 | * @deprecated |
||
| 25 | */ |
||
| 26 | public function oldMethod() |
||
| 27 | { |
||
| 28 | echo "Hello, I'm old method", PHP_EOL; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Method that is very tricky and should generate a notice |
||
| 33 | */ |
||
| 34 | public function notSoGoodMethod() |
||
| 35 | { |
||
| 36 | $value = round(microtime(true)) % 3; // Sometimes this equal to 0 |
||
| 37 | |||
| 38 | return rand(1, 10) / $value; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |