bug28800.phpt 614 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug #28800 (Incorrect string to number conversion for strings starting with 'inf')
  3. --FILE--
  4. <?php
  5. $strings = array('into', 'info', 'inf', 'infinity', 'infin', 'inflammable');
  6. foreach ($strings as $v) {
  7. try {
  8. echo ($v+0)."\n";
  9. } catch (\TypeError $e) {
  10. echo $e->getMessage() . \PHP_EOL;
  11. }
  12. }
  13. ?>
  14. --EXPECT--
  15. Unsupported operand types: string + int
  16. Unsupported operand types: string + int
  17. Unsupported operand types: string + int
  18. Unsupported operand types: string + int
  19. Unsupported operand types: string + int
  20. Unsupported operand types: string + int