summaryrefslogtreecommitdiff
path: root/Zend/tests/compare_002_64bit.phpt
blob: 517e7b9432879df3c68fbc5a6b14e61841b7c616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
--TEST--
comparing different variables for identity
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php

class test {
}

$a = array(
	array(1,2,3),
	"",
	1,
	2.5,
	0,
	"string",
	"123",
	"2.5",
	NULL,
	true,
	false,
	new stdclass,
	new stdclass,
	new test,
	array(),
	-PHP_INT_MAX-1,
	(string)(-PHP_INT_MAX-1),
);

$var_cnt = count($a);

function my_dump($var) {
	ob_start();
	var_dump($var);
	$buf = ob_get_clean();
	echo str_replace("\n", "", $buf);
}

foreach($a as $var) {
	for ($i = 0; $i < $var_cnt; $i++) {
		my_dump($var);
		echo ($var === $a[$i]) ? " === " : " !== ";
		my_dump($a[$i]);
		echo "\n";
	}
}	

echo "Done\n";
?>
--EXPECTF--	
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} === array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== string(0) ""
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== int(1)
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== float(2.5)
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== int(0)
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== string(6) "string"
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== string(3) "123"
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== string(3) "2.5"
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== NULL
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== bool(true)
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== bool(false)
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== object(stdClass)#%d (0) {}
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== object(stdClass)#%d (0) {}
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== object(test)#%d (0) {}
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== array(0) {}
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== int(-9223372036854775808)
array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)} !== string(20) "-9223372036854775808"
string(0) "" !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
string(0) "" === string(0) ""
string(0) "" !== int(1)
string(0) "" !== float(2.5)
string(0) "" !== int(0)
string(0) "" !== string(6) "string"
string(0) "" !== string(3) "123"
string(0) "" !== string(3) "2.5"
string(0) "" !== NULL
string(0) "" !== bool(true)
string(0) "" !== bool(false)
string(0) "" !== object(stdClass)#%d (0) {}
string(0) "" !== object(stdClass)#%d (0) {}
string(0) "" !== object(test)#%d (0) {}
string(0) "" !== array(0) {}
string(0) "" !== int(-9223372036854775808)
string(0) "" !== string(20) "-9223372036854775808"
int(1) !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
int(1) !== string(0) ""
int(1) === int(1)
int(1) !== float(2.5)
int(1) !== int(0)
int(1) !== string(6) "string"
int(1) !== string(3) "123"
int(1) !== string(3) "2.5"
int(1) !== NULL
int(1) !== bool(true)
int(1) !== bool(false)
int(1) !== object(stdClass)#%d (0) {}
int(1) !== object(stdClass)#%d (0) {}
int(1) !== object(test)#%d (0) {}
int(1) !== array(0) {}
int(1) !== int(-9223372036854775808)
int(1) !== string(20) "-9223372036854775808"
float(2.5) !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
float(2.5) !== string(0) ""
float(2.5) !== int(1)
float(2.5) === float(2.5)
float(2.5) !== int(0)
float(2.5) !== string(6) "string"
float(2.5) !== string(3) "123"
float(2.5) !== string(3) "2.5"
float(2.5) !== NULL
float(2.5) !== bool(true)
float(2.5) !== bool(false)
float(2.5) !== object(stdClass)#%d (0) {}
float(2.5) !== object(stdClass)#%d (0) {}
float(2.5) !== object(test)#%d (0) {}
float(2.5) !== array(0) {}
float(2.5) !== int(-9223372036854775808)
float(2.5) !== string(20) "-9223372036854775808"
int(0) !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
int(0) !== string(0) ""
int(0) !== int(1)
int(0) !== float(2.5)
int(0) === int(0)
int(0) !== string(6) "string"
int(0) !== string(3) "123"
int(0) !== string(3) "2.5"
int(0) !== NULL
int(0) !== bool(true)
int(0) !== bool(false)
int(0) !== object(stdClass)#%d (0) {}
int(0) !== object(stdClass)#%d (0) {}
int(0) !== object(test)#%d (0) {}
int(0) !== array(0) {}
int(0) !== int(-9223372036854775808)
int(0) !== string(20) "-9223372036854775808"
string(6) "string" !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
string(6) "string" !== string(0) ""
string(6) "string" !== int(1)
string(6) "string" !== float(2.5)
string(6) "string" !== int(0)
string(6) "string" === string(6) "string"
string(6) "string" !== string(3) "123"
string(6) "string" !== string(3) "2.5"
string(6) "string" !== NULL
string(6) "string" !== bool(true)
string(6) "string" !== bool(false)
string(6) "string" !== object(stdClass)#%d (0) {}
string(6) "string" !== object(stdClass)#%d (0) {}
string(6) "string" !== object(test)#%d (0) {}
string(6) "string" !== array(0) {}
string(6) "string" !== int(-9223372036854775808)
string(6) "string" !== string(20) "-9223372036854775808"
string(3) "123" !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
string(3) "123" !== string(0) ""
string(3) "123" !== int(1)
string(3) "123" !== float(2.5)
string(3) "123" !== int(0)
string(3) "123" !== string(6) "string"
string(3) "123" === string(3) "123"
string(3) "123" !== string(3) "2.5"
string(3) "123" !== NULL
string(3) "123" !== bool(true)
string(3) "123" !== bool(false)
string(3) "123" !== object(stdClass)#%d (0) {}
string(3) "123" !== object(stdClass)#%d (0) {}
string(3) "123" !== object(test)#%d (0) {}
string(3) "123" !== array(0) {}
string(3) "123" !== int(-9223372036854775808)
string(3) "123" !== string(20) "-9223372036854775808"
string(3) "2.5" !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
string(3) "2.5" !== string(0) ""
string(3) "2.5" !== int(1)
string(3) "2.5" !== float(2.5)
string(3) "2.5" !== int(0)
string(3) "2.5" !== string(6) "string"
string(3) "2.5" !== string(3) "123"
string(3) "2.5" === string(3) "2.5"
string(3) "2.5" !== NULL
string(3) "2.5" !== bool(true)
string(3) "2.5" !== bool(false)
string(3) "2.5" !== object(stdClass)#%d (0) {}
string(3) "2.5" !== object(stdClass)#%d (0) {}
string(3) "2.5" !== object(test)#%d (0) {}
string(3) "2.5" !== array(0) {}
string(3) "2.5" !== int(-9223372036854775808)
string(3) "2.5" !== string(20) "-9223372036854775808"
NULL !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
NULL !== string(0) ""
NULL !== int(1)
NULL !== float(2.5)
NULL !== int(0)
NULL !== string(6) "string"
NULL !== string(3) "123"
NULL !== string(3) "2.5"
NULL === NULL
NULL !== bool(true)
NULL !== bool(false)
NULL !== object(stdClass)#%d (0) {}
NULL !== object(stdClass)#%d (0) {}
NULL !== object(test)#%d (0) {}
NULL !== array(0) {}
NULL !== int(-9223372036854775808)
NULL !== string(20) "-9223372036854775808"
bool(true) !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
bool(true) !== string(0) ""
bool(true) !== int(1)
bool(true) !== float(2.5)
bool(true) !== int(0)
bool(true) !== string(6) "string"
bool(true) !== string(3) "123"
bool(true) !== string(3) "2.5"
bool(true) !== NULL
bool(true) === bool(true)
bool(true) !== bool(false)
bool(true) !== object(stdClass)#%d (0) {}
bool(true) !== object(stdClass)#%d (0) {}
bool(true) !== object(test)#%d (0) {}
bool(true) !== array(0) {}
bool(true) !== int(-9223372036854775808)
bool(true) !== string(20) "-9223372036854775808"
bool(false) !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
bool(false) !== string(0) ""
bool(false) !== int(1)
bool(false) !== float(2.5)
bool(false) !== int(0)
bool(false) !== string(6) "string"
bool(false) !== string(3) "123"
bool(false) !== string(3) "2.5"
bool(false) !== NULL
bool(false) !== bool(true)
bool(false) === bool(false)
bool(false) !== object(stdClass)#%d (0) {}
bool(false) !== object(stdClass)#%d (0) {}
bool(false) !== object(test)#%d (0) {}
bool(false) !== array(0) {}
bool(false) !== int(-9223372036854775808)
bool(false) !== string(20) "-9223372036854775808"
object(stdClass)#%d (0) {} !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
object(stdClass)#%d (0) {} !== string(0) ""
object(stdClass)#%d (0) {} !== int(1)
object(stdClass)#%d (0) {} !== float(2.5)
object(stdClass)#%d (0) {} !== int(0)
object(stdClass)#%d (0) {} !== string(6) "string"
object(stdClass)#%d (0) {} !== string(3) "123"
object(stdClass)#%d (0) {} !== string(3) "2.5"
object(stdClass)#%d (0) {} !== NULL
object(stdClass)#%d (0) {} !== bool(true)
object(stdClass)#%d (0) {} !== bool(false)
object(stdClass)#%d (0) {} === object(stdClass)#%d (0) {}
object(stdClass)#%d (0) {} !== object(stdClass)#%d (0) {}
object(stdClass)#%d (0) {} !== object(test)#%d (0) {}
object(stdClass)#%d (0) {} !== array(0) {}
object(stdClass)#%d (0) {} !== int(-9223372036854775808)
object(stdClass)#%d (0) {} !== string(20) "-9223372036854775808"
object(stdClass)#%d (0) {} !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
object(stdClass)#%d (0) {} !== string(0) ""
object(stdClass)#%d (0) {} !== int(1)
object(stdClass)#%d (0) {} !== float(2.5)
object(stdClass)#%d (0) {} !== int(0)
object(stdClass)#%d (0) {} !== string(6) "string"
object(stdClass)#%d (0) {} !== string(3) "123"
object(stdClass)#%d (0) {} !== string(3) "2.5"
object(stdClass)#%d (0) {} !== NULL
object(stdClass)#%d (0) {} !== bool(true)
object(stdClass)#%d (0) {} !== bool(false)
object(stdClass)#%d (0) {} !== object(stdClass)#%d (0) {}
object(stdClass)#%d (0) {} === object(stdClass)#%d (0) {}
object(stdClass)#%d (0) {} !== object(test)#%d (0) {}
object(stdClass)#%d (0) {} !== array(0) {}
object(stdClass)#%d (0) {} !== int(-9223372036854775808)
object(stdClass)#%d (0) {} !== string(20) "-9223372036854775808"
object(test)#%d (0) {} !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
object(test)#%d (0) {} !== string(0) ""
object(test)#%d (0) {} !== int(1)
object(test)#%d (0) {} !== float(2.5)
object(test)#%d (0) {} !== int(0)
object(test)#%d (0) {} !== string(6) "string"
object(test)#%d (0) {} !== string(3) "123"
object(test)#%d (0) {} !== string(3) "2.5"
object(test)#%d (0) {} !== NULL
object(test)#%d (0) {} !== bool(true)
object(test)#%d (0) {} !== bool(false)
object(test)#%d (0) {} !== object(stdClass)#%d (0) {}
object(test)#%d (0) {} !== object(stdClass)#%d (0) {}
object(test)#%d (0) {} === object(test)#%d (0) {}
object(test)#%d (0) {} !== array(0) {}
object(test)#%d (0) {} !== int(-9223372036854775808)
object(test)#%d (0) {} !== string(20) "-9223372036854775808"
array(0) {} !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
array(0) {} !== string(0) ""
array(0) {} !== int(1)
array(0) {} !== float(2.5)
array(0) {} !== int(0)
array(0) {} !== string(6) "string"
array(0) {} !== string(3) "123"
array(0) {} !== string(3) "2.5"
array(0) {} !== NULL
array(0) {} !== bool(true)
array(0) {} !== bool(false)
array(0) {} !== object(stdClass)#%d (0) {}
array(0) {} !== object(stdClass)#%d (0) {}
array(0) {} !== object(test)#%d (0) {}
array(0) {} === array(0) {}
array(0) {} !== int(-9223372036854775808)
array(0) {} !== string(20) "-9223372036854775808"
int(-9223372036854775808) !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
int(-9223372036854775808) !== string(0) ""
int(-9223372036854775808) !== int(1)
int(-9223372036854775808) !== float(2.5)
int(-9223372036854775808) !== int(0)
int(-9223372036854775808) !== string(6) "string"
int(-9223372036854775808) !== string(3) "123"
int(-9223372036854775808) !== string(3) "2.5"
int(-9223372036854775808) !== NULL
int(-9223372036854775808) !== bool(true)
int(-9223372036854775808) !== bool(false)
int(-9223372036854775808) !== object(stdClass)#%d (0) {}
int(-9223372036854775808) !== object(stdClass)#%d (0) {}
int(-9223372036854775808) !== object(test)#%d (0) {}
int(-9223372036854775808) !== array(0) {}
int(-9223372036854775808) === int(-9223372036854775808)
int(-9223372036854775808) !== string(20) "-9223372036854775808"
string(20) "-9223372036854775808" !== array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}
string(20) "-9223372036854775808" !== string(0) ""
string(20) "-9223372036854775808" !== int(1)
string(20) "-9223372036854775808" !== float(2.5)
string(20) "-9223372036854775808" !== int(0)
string(20) "-9223372036854775808" !== string(6) "string"
string(20) "-9223372036854775808" !== string(3) "123"
string(20) "-9223372036854775808" !== string(3) "2.5"
string(20) "-9223372036854775808" !== NULL
string(20) "-9223372036854775808" !== bool(true)
string(20) "-9223372036854775808" !== bool(false)
string(20) "-9223372036854775808" !== object(stdClass)#%d (0) {}
string(20) "-9223372036854775808" !== object(stdClass)#%d (0) {}
string(20) "-9223372036854775808" !== object(test)#%d (0) {}
string(20) "-9223372036854775808" !== array(0) {}
string(20) "-9223372036854775808" !== int(-9223372036854775808)
string(20) "-9223372036854775808" === string(20) "-9223372036854775808"
Done