xref: /PHP-8.2/Zend/tests/add_004.phpt (revision cdaf3503)
1--TEST--
2adding numbers to arrays
3--FILE--
4<?php
5
6$a = array(1,2,3);
7
8try {
9    var_dump($a + 5);
10} catch (Error $e) {
11    echo "\nException: " . $e->getMessage() . "\n";
12}
13
14$c = $a + 5;
15var_dump($c);
16
17echo "Done\n";
18?>
19--EXPECTF--
20Exception: Unsupported operand types: array + int
21
22Fatal error: Uncaught TypeError: Unsupported operand types: array + int in %s:%d
23Stack trace:
24#0 {main}
25  thrown in %s on line %d
26