source: src/router/php7/Zend/tests/numeric_string_errors_assign.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

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