1--TEST--
2Test | operator : various numbers as strings
3--FILE--
4<?php
5
6$strVals = array(
7   "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
8   "a5.9"
9);
10
11error_reporting(E_ERROR);
12
13foreach ($strVals as $strVal) {
14   foreach($strVals as $otherVal) {
15	   echo "--- testing: '$strVal' | '$otherVal' ---\n";
16      var_dump(bin2hex($strVal|$otherVal));
17   }
18}
19
20
21?>
22===DONE===
23--EXPECT--
24--- testing: '0' | '0' ---
25string(2) "30"
26--- testing: '0' | '65' ---
27string(4) "3635"
28--- testing: '0' | '-44' ---
29string(6) "3d3434"
30--- testing: '0' | '1.2' ---
31string(6) "312e32"
32--- testing: '0' | '-7.7' ---
33string(8) "3d372e37"
34--- testing: '0' | 'abc' ---
35string(6) "716263"
36--- testing: '0' | '123abc' ---
37string(12) "313233616263"
38--- testing: '0' | '123e5' ---
39string(10) "3132336535"
40--- testing: '0' | '123e5xyz' ---
41string(16) "313233653578797a"
42--- testing: '0' | ' 123abc' ---
43string(14) "30313233616263"
44--- testing: '0' | '123 abc' ---
45string(14) "31323320616263"
46--- testing: '0' | '123abc ' ---
47string(14) "31323361626320"
48--- testing: '0' | '3.4a' ---
49string(8) "332e3461"
50--- testing: '0' | 'a5.9' ---
51string(8) "71352e39"
52--- testing: '65' | '0' ---
53string(4) "3635"
54--- testing: '65' | '65' ---
55string(4) "3635"
56--- testing: '65' | '-44' ---
57string(6) "3f3534"
58--- testing: '65' | '1.2' ---
59string(6) "373f32"
60--- testing: '65' | '-7.7' ---
61string(8) "3f372e37"
62--- testing: '65' | 'abc' ---
63string(6) "777763"
64--- testing: '65' | '123abc' ---
65string(12) "373733616263"
66--- testing: '65' | '123e5' ---
67string(10) "3737336535"
68--- testing: '65' | '123e5xyz' ---
69string(16) "373733653578797a"
70--- testing: '65' | ' 123abc' ---
71string(14) "36353233616263"
72--- testing: '65' | '123 abc' ---
73string(14) "37373320616263"
74--- testing: '65' | '123abc ' ---
75string(14) "37373361626320"
76--- testing: '65' | '3.4a' ---
77string(8) "373f3461"
78--- testing: '65' | 'a5.9' ---
79string(8) "77352e39"
80--- testing: '-44' | '0' ---
81string(6) "3d3434"
82--- testing: '-44' | '65' ---
83string(6) "3f3534"
84--- testing: '-44' | '-44' ---
85string(6) "2d3434"
86--- testing: '-44' | '1.2' ---
87string(6) "3d3e36"
88--- testing: '-44' | '-7.7' ---
89string(8) "2d373e37"
90--- testing: '-44' | 'abc' ---
91string(6) "6d7677"
92--- testing: '-44' | '123abc' ---
93string(12) "3d3637616263"
94--- testing: '-44' | '123e5' ---
95string(10) "3d36376535"
96--- testing: '-44' | '123e5xyz' ---
97string(16) "3d3637653578797a"
98--- testing: '-44' | ' 123abc' ---
99string(14) "2d353633616263"
100--- testing: '-44' | '123 abc' ---
101string(14) "3d363720616263"
102--- testing: '-44' | '123abc ' ---
103string(14) "3d363761626320"
104--- testing: '-44' | '3.4a' ---
105string(8) "3f3e3461"
106--- testing: '-44' | 'a5.9' ---
107string(8) "6d353e39"
108--- testing: '1.2' | '0' ---
109string(6) "312e32"
110--- testing: '1.2' | '65' ---
111string(6) "373f32"
112--- testing: '1.2' | '-44' ---
113string(6) "3d3e36"
114--- testing: '1.2' | '1.2' ---
115string(6) "312e32"
116--- testing: '1.2' | '-7.7' ---
117string(8) "3d3f3e37"
118--- testing: '1.2' | 'abc' ---
119string(6) "716e73"
120--- testing: '1.2' | '123abc' ---
121string(12) "313e33616263"
122--- testing: '1.2' | '123e5' ---
123string(10) "313e336535"
124--- testing: '1.2' | '123e5xyz' ---
125string(16) "313e33653578797a"
126--- testing: '1.2' | ' 123abc' ---
127string(14) "313f3233616263"
128--- testing: '1.2' | '123 abc' ---
129string(14) "313e3320616263"
130--- testing: '1.2' | '123abc ' ---
131string(14) "313e3361626320"
132--- testing: '1.2' | '3.4a' ---
133string(8) "332e3661"
134--- testing: '1.2' | 'a5.9' ---
135string(8) "713f3e39"
136--- testing: '-7.7' | '0' ---
137string(8) "3d372e37"
138--- testing: '-7.7' | '65' ---
139string(8) "3f372e37"
140--- testing: '-7.7' | '-44' ---
141string(8) "2d373e37"
142--- testing: '-7.7' | '1.2' ---
143string(8) "3d3f3e37"
144--- testing: '-7.7' | '-7.7' ---
145string(8) "2d372e37"
146--- testing: '-7.7' | 'abc' ---
147string(8) "6d776f37"
148--- testing: '-7.7' | '123abc' ---
149string(12) "3d373f776263"
150--- testing: '-7.7' | '123e5' ---
151string(10) "3d373f7735"
152--- testing: '-7.7' | '123e5xyz' ---
153string(16) "3d373f773578797a"
154--- testing: '-7.7' | ' 123abc' ---
155string(14) "2d373e37616263"
156--- testing: '-7.7' | '123 abc' ---
157string(14) "3d373f37616263"
158--- testing: '-7.7' | '123abc ' ---
159string(14) "3d373f77626320"
160--- testing: '-7.7' | '3.4a' ---
161string(8) "3f3f3e77"
162--- testing: '-7.7' | 'a5.9' ---
163string(8) "6d372e3f"
164--- testing: 'abc' | '0' ---
165string(6) "716263"
166--- testing: 'abc' | '65' ---
167string(6) "777763"
168--- testing: 'abc' | '-44' ---
169string(6) "6d7677"
170--- testing: 'abc' | '1.2' ---
171string(6) "716e73"
172--- testing: 'abc' | '-7.7' ---
173string(8) "6d776f37"
174--- testing: 'abc' | 'abc' ---
175string(6) "616263"
176--- testing: 'abc' | '123abc' ---
177string(12) "717273616263"
178--- testing: 'abc' | '123e5' ---
179string(10) "7172736535"
180--- testing: 'abc' | '123e5xyz' ---
181string(16) "717273653578797a"
182--- testing: 'abc' | ' 123abc' ---
183string(14) "61737333616263"
184--- testing: 'abc' | '123 abc' ---
185string(14) "71727320616263"
186--- testing: 'abc' | '123abc ' ---
187string(14) "71727361626320"
188--- testing: 'abc' | '3.4a' ---
189string(8) "736e7761"
190--- testing: 'abc' | 'a5.9' ---
191string(8) "61776f39"
192--- testing: '123abc' | '0' ---
193string(12) "313233616263"
194--- testing: '123abc' | '65' ---
195string(12) "373733616263"
196--- testing: '123abc' | '-44' ---
197string(12) "3d3637616263"
198--- testing: '123abc' | '1.2' ---
199string(12) "313e33616263"
200--- testing: '123abc' | '-7.7' ---
201string(12) "3d373f776263"
202--- testing: '123abc' | 'abc' ---
203string(12) "717273616263"
204--- testing: '123abc' | '123abc' ---
205string(12) "313233616263"
206--- testing: '123abc' | '123e5' ---
207string(12) "313233657763"
208--- testing: '123abc' | '123e5xyz' ---
209string(16) "31323365777b797a"
210--- testing: '123abc' | ' 123abc' ---
211string(14) "31333373636363"
212--- testing: '123abc' | '123 abc' ---
213string(14) "31323361636363"
214--- testing: '123abc' | '123abc ' ---
215string(14) "31323361626320"
216--- testing: '123abc' | '3.4a' ---
217string(12) "333e37616263"
218--- testing: '123abc' | 'a5.9' ---
219string(12) "71373f796263"
220--- testing: '123e5' | '0' ---
221string(10) "3132336535"
222--- testing: '123e5' | '65' ---
223string(10) "3737336535"
224--- testing: '123e5' | '-44' ---
225string(10) "3d36376535"
226--- testing: '123e5' | '1.2' ---
227string(10) "313e336535"
228--- testing: '123e5' | '-7.7' ---
229string(10) "3d373f7735"
230--- testing: '123e5' | 'abc' ---
231string(10) "7172736535"
232--- testing: '123e5' | '123abc' ---
233string(12) "313233657763"
234--- testing: '123e5' | '123e5' ---
235string(10) "3132336535"
236--- testing: '123e5' | '123e5xyz' ---
237string(16) "313233653578797a"
238--- testing: '123e5' | ' 123abc' ---
239string(14) "31333377756263"
240--- testing: '123e5' | '123 abc' ---
241string(14) "31323365756263"
242--- testing: '123e5' | '123abc ' ---
243string(14) "31323365776320"
244--- testing: '123e5' | '3.4a' ---
245string(10) "333e376535"
246--- testing: '123e5' | 'a5.9' ---
247string(10) "71373f7d35"
248--- testing: '123e5xyz' | '0' ---
249string(16) "313233653578797a"
250--- testing: '123e5xyz' | '65' ---
251string(16) "373733653578797a"
252--- testing: '123e5xyz' | '-44' ---
253string(16) "3d3637653578797a"
254--- testing: '123e5xyz' | '1.2' ---
255string(16) "313e33653578797a"
256--- testing: '123e5xyz' | '-7.7' ---
257string(16) "3d373f773578797a"
258--- testing: '123e5xyz' | 'abc' ---
259string(16) "717273653578797a"
260--- testing: '123e5xyz' | '123abc' ---
261string(16) "31323365777b797a"
262--- testing: '123e5xyz' | '123e5' ---
263string(16) "313233653578797a"
264--- testing: '123e5xyz' | '123e5xyz' ---
265string(16) "313233653578797a"
266--- testing: '123e5xyz' | ' 123abc' ---
267string(16) "31333377757a7b7a"
268--- testing: '123e5xyz' | '123 abc' ---
269string(16) "31323365757a7b7a"
270--- testing: '123e5xyz' | '123abc ' ---
271string(16) "31323365777b797a"
272--- testing: '123e5xyz' | '3.4a' ---
273string(16) "333e37653578797a"
274--- testing: '123e5xyz' | 'a5.9' ---
275string(16) "71373f7d3578797a"
276--- testing: ' 123abc' | '0' ---
277string(14) "30313233616263"
278--- testing: ' 123abc' | '65' ---
279string(14) "36353233616263"
280--- testing: ' 123abc' | '-44' ---
281string(14) "2d353633616263"
282--- testing: ' 123abc' | '1.2' ---
283string(14) "313f3233616263"
284--- testing: ' 123abc' | '-7.7' ---
285string(14) "2d373e37616263"
286--- testing: ' 123abc' | 'abc' ---
287string(14) "61737333616263"
288--- testing: ' 123abc' | '123abc' ---
289string(14) "31333373636363"
290--- testing: ' 123abc' | '123e5' ---
291string(14) "31333377756263"
292--- testing: ' 123abc' | '123e5xyz' ---
293string(16) "31333377757a7b7a"
294--- testing: ' 123abc' | ' 123abc' ---
295string(14) "20313233616263"
296--- testing: ' 123abc' | '123 abc' ---
297string(14) "31333333616263"
298--- testing: ' 123abc' | '123abc ' ---
299string(14) "31333373636363"
300--- testing: ' 123abc' | '3.4a' ---
301string(14) "333f3673616263"
302--- testing: ' 123abc' | 'a5.9' ---
303string(14) "61353e3b616263"
304--- testing: '123 abc' | '0' ---
305string(14) "31323320616263"
306--- testing: '123 abc' | '65' ---
307string(14) "37373320616263"
308--- testing: '123 abc' | '-44' ---
309string(14) "3d363720616263"
310--- testing: '123 abc' | '1.2' ---
311string(14) "313e3320616263"
312--- testing: '123 abc' | '-7.7' ---
313string(14) "3d373f37616263"
314--- testing: '123 abc' | 'abc' ---
315string(14) "71727320616263"
316--- testing: '123 abc' | '123abc' ---
317string(14) "31323361636363"
318--- testing: '123 abc' | '123e5' ---
319string(14) "31323365756263"
320--- testing: '123 abc' | '123e5xyz' ---
321string(16) "31323365757a7b7a"
322--- testing: '123 abc' | ' 123abc' ---
323string(14) "31333333616263"
324--- testing: '123 abc' | '123 abc' ---
325string(14) "31323320616263"
326--- testing: '123 abc' | '123abc ' ---
327string(14) "31323361636363"
328--- testing: '123 abc' | '3.4a' ---
329string(14) "333e3761616263"
330--- testing: '123 abc' | 'a5.9' ---
331string(14) "71373f39616263"
332--- testing: '123abc ' | '0' ---
333string(14) "31323361626320"
334--- testing: '123abc ' | '65' ---
335string(14) "37373361626320"
336--- testing: '123abc ' | '-44' ---
337string(14) "3d363761626320"
338--- testing: '123abc ' | '1.2' ---
339string(14) "313e3361626320"
340--- testing: '123abc ' | '-7.7' ---
341string(14) "3d373f77626320"
342--- testing: '123abc ' | 'abc' ---
343string(14) "71727361626320"
344--- testing: '123abc ' | '123abc' ---
345string(14) "31323361626320"
346--- testing: '123abc ' | '123e5' ---
347string(14) "31323365776320"
348--- testing: '123abc ' | '123e5xyz' ---
349string(16) "31323365777b797a"
350--- testing: '123abc ' | ' 123abc' ---
351string(14) "31333373636363"
352--- testing: '123abc ' | '123 abc' ---
353string(14) "31323361636363"
354--- testing: '123abc ' | '123abc ' ---
355string(14) "31323361626320"
356--- testing: '123abc ' | '3.4a' ---
357string(14) "333e3761626320"
358--- testing: '123abc ' | 'a5.9' ---
359string(14) "71373f79626320"
360--- testing: '3.4a' | '0' ---
361string(8) "332e3461"
362--- testing: '3.4a' | '65' ---
363string(8) "373f3461"
364--- testing: '3.4a' | '-44' ---
365string(8) "3f3e3461"
366--- testing: '3.4a' | '1.2' ---
367string(8) "332e3661"
368--- testing: '3.4a' | '-7.7' ---
369string(8) "3f3f3e77"
370--- testing: '3.4a' | 'abc' ---
371string(8) "736e7761"
372--- testing: '3.4a' | '123abc' ---
373string(12) "333e37616263"
374--- testing: '3.4a' | '123e5' ---
375string(10) "333e376535"
376--- testing: '3.4a' | '123e5xyz' ---
377string(16) "333e37653578797a"
378--- testing: '3.4a' | ' 123abc' ---
379string(14) "333f3673616263"
380--- testing: '3.4a' | '123 abc' ---
381string(14) "333e3761616263"
382--- testing: '3.4a' | '123abc ' ---
383string(14) "333e3761626320"
384--- testing: '3.4a' | '3.4a' ---
385string(8) "332e3461"
386--- testing: '3.4a' | 'a5.9' ---
387string(8) "733f3e79"
388--- testing: 'a5.9' | '0' ---
389string(8) "71352e39"
390--- testing: 'a5.9' | '65' ---
391string(8) "77352e39"
392--- testing: 'a5.9' | '-44' ---
393string(8) "6d353e39"
394--- testing: 'a5.9' | '1.2' ---
395string(8) "713f3e39"
396--- testing: 'a5.9' | '-7.7' ---
397string(8) "6d372e3f"
398--- testing: 'a5.9' | 'abc' ---
399string(8) "61776f39"
400--- testing: 'a5.9' | '123abc' ---
401string(12) "71373f796263"
402--- testing: 'a5.9' | '123e5' ---
403string(10) "71373f7d35"
404--- testing: 'a5.9' | '123e5xyz' ---
405string(16) "71373f7d3578797a"
406--- testing: 'a5.9' | ' 123abc' ---
407string(14) "61353e3b616263"
408--- testing: 'a5.9' | '123 abc' ---
409string(14) "71373f39616263"
410--- testing: 'a5.9' | '123abc ' ---
411string(14) "71373f79626320"
412--- testing: 'a5.9' | '3.4a' ---
413string(8) "733f3e79"
414--- testing: 'a5.9' | 'a5.9' ---
415string(8) "61352e39"
416===DONE===
417