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