bitwise_not_precision_exception.phpt 318 B

123456789101112131415
  1. --TEST--
  2. Promoting float precision warning to exception in bitwise_not
  3. --FILE--
  4. <?php
  5. set_error_handler(function($_, $msg) {
  6. throw new Exception($msg);
  7. });
  8. try {
  9. var_dump(~INF);
  10. } catch (Exception $e) {
  11. echo $e->getMessage(), "\n";
  12. }
  13. ?>
  14. --EXPECT--
  15. Implicit conversion from float INF to int loses precision