Skip to content

Commit cdaf350

Browse files
committed
Improve "unsupported operands" error
By mentioning the operand types. We can do that now, as the original operand types now remain available. Closes GH-5330.
1 parent 9c0afc8 commit cdaf350

16 files changed

+50
-43
lines changed

Zend/tests/add_002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ var_dump($c);
2020
echo "Done\n";
2121
?>
2222
--EXPECTF--
23-
Exception: Unsupported operand types
23+
Exception: Unsupported operand types: array + object
2424

25-
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
25+
Fatal error: Uncaught TypeError: Unsupported operand types: array + object in %s:%d
2626
Stack trace:
2727
#0 {main}
2828
thrown in %s on line %d

Zend/tests/add_003.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ echo "Done\n";
2222
--EXPECTF--
2323
Notice: Object of class stdClass could not be converted to number in %sadd_003.php on line %d
2424

25-
Exception: Unsupported operand types
25+
Exception: Unsupported operand types: object + array
2626

2727
Notice: Object of class stdClass could not be converted to number in %s on line %d
2828

29-
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
29+
Fatal error: Uncaught TypeError: Unsupported operand types: object + array in %s:%d
3030
Stack trace:
3131
#0 {main}
3232
thrown in %s on line %d

Zend/tests/add_004.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ var_dump($c);
1717
echo "Done\n";
1818
?>
1919
--EXPECTF--
20-
Exception: Unsupported operand types
20+
Exception: Unsupported operand types: array + int
2121

22-
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
22+
Fatal error: Uncaught TypeError: Unsupported operand types: array + int in %s:%d
2323
Stack trace:
2424
#0 {main}
2525
thrown in %s on line %d

Zend/tests/add_007.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ var_dump($c);
1919
echo "Done\n";
2020
?>
2121
--EXPECTF--
22-
Exception: Unsupported operand types
22+
Exception: Unsupported operand types: array + string
2323

24-
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
24+
Fatal error: Uncaught TypeError: Unsupported operand types: array + string in %s:%d
2525
Stack trace:
2626
#0 {main}
2727
thrown in %s on line %d

Zend/tests/bug74084.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ try {
3131
}
3232
?>
3333
--EXPECT--
34-
Unsupported operand types
35-
Unsupported operand types
36-
Unsupported operand types
37-
Unsupported operand types
34+
Unsupported operand types: array - array
35+
Unsupported operand types: array * array
36+
Unsupported operand types: array / array
37+
Unsupported operand types: array ** array

Zend/tests/constant_expressions_exceptions_001.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ Constant Expressions with unsupported operands 001
33
--FILE--
44
<?php
55
const T = array(1,2) - array(0);
6-
--EXPECTF--
7-
Fatal error: Unsupported operand types in %sconstant_expressions_exceptions_001.php on line 2
6+
--EXPECT--
7+
Fatal error: Uncaught TypeError: Unsupported operand types: array - array in [no active file]:0
8+
Stack trace:
9+
#0 {main}
10+
thrown in [no active file] on line 0

Zend/tests/constant_expressions_exceptions_002.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ try {
1010
?>
1111
DONE
1212
--EXPECTF--
13-
Fatal error: Unsupported operand types in %sconstant_expressions_exceptions.inc on line 2
13+
Exception: Unsupported operand types: array - array in %s on line %d
14+
DONE

Zend/tests/div_002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ var_dump($c);
1818
echo "Done\n";
1919
?>
2020
--EXPECTF--
21-
Exception: Unsupported operand types
21+
Exception: Unsupported operand types: array / array
2222

23-
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
23+
Fatal error: Uncaught TypeError: Unsupported operand types: array / array in %s:%d
2424
Stack trace:
2525
#0 {main}
2626
thrown in %s on line %d

Zend/tests/mul_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ var_dump($c);
1818
echo "Done\n";
1919
?>
2020
--EXPECTF--
21-
Exception: Unsupported operand types
21+
Exception: Unsupported operand types: array * array
2222

23-
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
23+
Fatal error: Uncaught TypeError: Unsupported operand types: array * array in %s:%d
2424
Stack trace:
2525
#0 {main}
2626
thrown in %s on line %d

Zend/tests/pow_array_leak.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ var_dump($x);
2121

2222
?>
2323
--EXPECT--
24-
Unsupported operand types
24+
Unsupported operand types: array ** int
2525
array(1) {
2626
[0]=>
2727
int(0)
2828
}
29-
Unsupported operand types
29+
Unsupported operand types: array ** array
3030
array(1) {
3131
[0]=>
3232
int(0)

0 commit comments

Comments
 (0)