add_007.phpt 521 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. adding strings to arrays
  3. --FILE--
  4. <?php
  5. $a = array(1,2,3);
  6. $s1 = "some string";
  7. try {
  8. var_dump($a + $s1);
  9. } catch (Error $e) {
  10. echo "\nException: " . $e->getMessage() . "\n";
  11. }
  12. $c = $a + $s1;
  13. var_dump($c);
  14. echo "Done\n";
  15. ?>
  16. --EXPECTF--
  17. Warning: A non-numeric value encountered in %s on line %d
  18. Exception: Unsupported operand types
  19. Warning: A non-numeric value encountered in %s on line %d
  20. Fatal error: Uncaught Error: Unsupported operand types in %s:%d
  21. Stack trace:
  22. #0 {main}
  23. thrown in %s on line %d