1--TEST--
2Invalid numeric string TypeErrors and E_WARNINGs, combined assignment operations
3--FILE--
4<?php
5
6// prevents CT eval
7function foxcache($val) {
8    return [$val][0];
9}
10
11$a = foxcache("2 Lorem");
12$a += "3 ipsum";
13var_dump($a);
14try {
15    $a = foxcache("dolor");
16    $a += "sit";
17    var_dump($a);
18} catch (\TypeError $e) {
19    echo $e->getMessage() . \PHP_EOL;
20}
21echo "---", PHP_EOL;
22$a = foxcache("5 amet,");
23$a -= "7 consectetur";
24var_dump($a);
25try {
26    $a = foxcache("adipiscing");
27    $a -= "elit,";
28    var_dump($a);
29} catch (\TypeError $e) {
30    echo $e->getMessage() . \PHP_EOL;
31}
32echo "---", PHP_EOL;
33$a = foxcache("11 sed");
34$a *= "13 do";
35var_dump($a);
36try {
37    $a = foxcache("eiusmod");
38    $a *= "tempor";
39    var_dump($a);
40} catch (\TypeError $e) {
41    echo $e->getMessage() . \PHP_EOL;
42}
43echo "---", PHP_EOL;
44$a = foxcache("17 incididunt");
45$a /= "19 ut";
46var_dump($a);
47try {
48    $a = foxcache("labore");
49    $a /= "et";
50    var_dump($a);
51} catch (\TypeError $e) {
52    echo $e->getMessage() . \PHP_EOL;
53}
54echo "---", PHP_EOL;
55$a = foxcache("23 dolore");
56$a **= "29 magna";
57var_dump($a);
58try {
59    $a = foxcache("aliqua.");
60    $a **= "Ut";
61    var_dump($a);
62} catch (\TypeError $e) {
63    echo $e->getMessage() . \PHP_EOL;
64}
65echo "---", PHP_EOL;
66$a = foxcache("31 enim");
67$a %= "37 ad";
68var_dump($a);
69try {
70    $a = foxcache("minim");
71    $a %= "veniam,";
72    var_dump($a);
73} catch (\TypeError $e) {
74    echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL;
75}
76echo "---", PHP_EOL;
77$a = foxcache("41 minim");
78$a <<= "43 veniam,";
79try {
80    var_dump($a);
81    $a = foxcache("quis");
82    $a <<= "nostrud";
83} catch (\TypeError $e) {
84    echo $e->getMessage() . \PHP_EOL;
85}
86var_dump($a);
87echo "---", PHP_EOL;
88$a = foxcache("47 exercitation");
89$a >>= "53 ullamco";
90var_dump($a);
91try {
92    $a = foxcache("laboris");
93    $a >>= "nisi";
94    var_dump($a);
95} catch (\TypeError $e) {
96    echo $e->getMessage() . \PHP_EOL;
97}
98echo "---", PHP_EOL;
99$a = foxcache("59 ut");
100$a |= 61;
101var_dump($a);
102$a = foxcache(67);
103$a |= "71 aliquip";
104var_dump($a);
105try {
106    $a = foxcache("ex");
107    $a |= 73;
108    var_dump($a);
109} catch (\TypeError $e) {
110    echo $e->getMessage() . \PHP_EOL;
111}
112try {
113    $a = foxcache(79);
114    $a |= "ea";
115    var_dump($a);
116} catch (\TypeError $e) {
117    echo $e->getMessage() . \PHP_EOL;
118}
119echo "---", PHP_EOL;
120$a = foxcache("83 commodo");
121$a &= 89;
122var_dump($a);
123$a = foxcache(97);
124$a &= "101 consequat.";
125var_dump($a);
126try {
127    $a = foxcache("Duis");
128    $a &= 103;
129    var_dump($a);
130} catch (\TypeError $e) {
131    echo $e->getMessage() . \PHP_EOL;
132}
133try {
134    $a = foxcache(107);
135    $a &= "aute";
136    var_dump($a);
137} catch (\TypeError $e) {
138    echo $e->getMessage() . \PHP_EOL;
139}
140echo "---", PHP_EOL;
141$a = foxcache("109 irure");
142$a ^= 113;
143var_dump($a);
144$a = foxcache(127);
145$a ^= "131 dolor";
146var_dump($a);
147try {
148    $a = foxcache("in");
149    $a ^= 137;
150    var_dump($a);
151} catch (\TypeError $e) {
152    echo $e->getMessage() . \PHP_EOL;
153}
154try {
155    $a = foxcache(139);
156    $a ^= "reprehenderit";
157    var_dump($a);
158} catch (\TypeError $e) {
159    echo $e->getMessage() . \PHP_EOL;
160}
161?>
162--EXPECTF--
163Warning: A non-numeric value encountered in %s on line %d
164
165Warning: A non-numeric value encountered in %s on line %d
166int(5)
167Unsupported operand types: string + string
168---
169
170Warning: A non-numeric value encountered in %s on line %d
171
172Warning: A non-numeric value encountered in %s on line %d
173int(-2)
174Unsupported operand types: string - string
175---
176
177Warning: A non-numeric value encountered in %s on line %d
178
179Warning: A non-numeric value encountered in %s on line %d
180int(143)
181Unsupported operand types: string * string
182---
183
184Warning: A non-numeric value encountered in %s on line %d
185
186Warning: A non-numeric value encountered in %s on line %d
187float(0.8947368421052632)
188Unsupported operand types: string / string
189---
190
191Warning: A non-numeric value encountered in %s on line %d
192
193Warning: A non-numeric value encountered in %s on line %d
194float(3.0910586430935376E+39)
195Unsupported operand types: string ** string
196---
197
198Warning: A non-numeric value encountered in %s on line %d
199
200Warning: A non-numeric value encountered in %s on line %d
201int(31)
202TypeError: Unsupported operand types: string % string
203---
204
205Warning: A non-numeric value encountered in %s on line %d
206
207Warning: A non-numeric value encountered in %s on line %d
208int(%d)
209Unsupported operand types: string << string
210string(4) "quis"
211---
212
213Warning: A non-numeric value encountered in %s on line %d
214
215Warning: A non-numeric value encountered in %s on line %d
216int(0)
217Unsupported operand types: string >> string
218---
219
220Warning: A non-numeric value encountered in %s on line %d
221int(63)
222
223Warning: A non-numeric value encountered in %s on line %d
224int(71)
225Unsupported operand types: string | int
226Unsupported operand types: int | string
227---
228
229Warning: A non-numeric value encountered in %s on line %d
230int(81)
231
232Warning: A non-numeric value encountered in %s on line %d
233int(97)
234Unsupported operand types: string & int
235Unsupported operand types: int & string
236---
237
238Warning: A non-numeric value encountered in %s on line %d
239int(28)
240
241Warning: A non-numeric value encountered in %s on line %d
242int(252)
243Unsupported operand types: string ^ int
244Unsupported operand types: int ^ string
245