Annotation of embedaddon/php/ext/standard/tests/general_functions/debug_zval_dump_b_64bit.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test debug_zval_dump() function : basic operations
3: --SKIPIF--
4: <?php
5: if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6: ?>
7: --INI--
8: precision=14
9: allow_call_time_pass_reference=1
10: --FILE--
11: <?php
12: /* Prototype: void debug_zval_dump ( mixed $variable );
13: Description: Dumps a string representation of an internal zend value
14: to output.
15: */
16:
17: /* creating file resource */
18: $file_handle = fopen(__FILE__, "r");
19:
20: echo "*** Testing debug_zval_dump() on scalar and non-scalar variables ***\n";
21: $values = array (
22: /* integers */
23: 0, // zero as argument
24: 000000123, //octal value of 83
25: 123000000,
26: -00000123, //octal value of 83
27: -12300000,
28: 0xffffff, //hexadecimal value
29: 123456789,
30: 1,
31: -1,
32:
33: /* floats */
34: -0.0,
35: +0.0,
36: 1.234,
37: -1.234,
38: -2.000000,
39: 2.0000000,
40: -4.0001e+5,
41: 4.0001E+5,
42: 6.99999989,
43: -.5,
44: .567,
45: -.6700000e-3,
46: -.6700000E+3,
47: 1E-5,
48: -1e+5,
49: 1e+5,
50: 1E-5,
51:
52: /* strings */
53: "",
54: '',
55: " ",
56: ' ',
57: "0",
58: "\0",
59: '\0',
60: "\t",
61: '\t',
62: "PHP",
63: 'PHP',
64: "1234\t\n5678\n\t9100\rabcda\x0000cdeh\0stuv", // strings with escape chars
65:
66: /* boolean */
67: TRUE,
68: FALSE,
69: true,
70: false,
71:
72: /* arrays */
73: array(),
74: array(NULL),
75: array(true),
76: array(""),
77: array(''),
78: array(array(1, 2), array('a', 'b')),
79: array("test" => "is_array", 1 => 'One'),
80: array(0),
81: array(-1),
82: array(10.5, 5.6),
83: array("string", "test"),
84: array('string', 'test'),
85:
86: /* resources */
87: $file_handle
88: );
89: /* loop to display the variables and its reference count using
90: debug_zval_dump() */
91: $counter = 1;
92: foreach( $values as $value ) {
93: echo "-- Iteration $counter --\n";
94: debug_zval_dump( $value );
95: debug_zval_dump( &$value );
96: $counter++;
97: }
98:
99: /* closing resource handle */
100: fclose($file_handle);
101:
102: echo "Done\n";
103: ?>
104: --EXPECTF--
105: *** Testing debug_zval_dump() on scalar and non-scalar variables ***
106: -- Iteration 1 --
107: long(0) refcount(3)
108: &long(0) refcount(2)
109: -- Iteration 2 --
110: long(83) refcount(3)
111: &long(83) refcount(2)
112: -- Iteration 3 --
113: long(123000000) refcount(3)
114: &long(123000000) refcount(2)
115: -- Iteration 4 --
116: long(-83) refcount(3)
117: &long(-83) refcount(2)
118: -- Iteration 5 --
119: long(-12300000) refcount(3)
120: &long(-12300000) refcount(2)
121: -- Iteration 6 --
122: long(16777215) refcount(3)
123: &long(16777215) refcount(2)
124: -- Iteration 7 --
125: long(123456789) refcount(3)
126: &long(123456789) refcount(2)
127: -- Iteration 8 --
128: long(1) refcount(3)
129: &long(1) refcount(2)
130: -- Iteration 9 --
131: long(-1) refcount(3)
132: &long(-1) refcount(2)
133: -- Iteration 10 --
134: double(0) refcount(3)
135: &double(0) refcount(2)
136: -- Iteration 11 --
137: double(0) refcount(3)
138: &double(0) refcount(2)
139: -- Iteration 12 --
140: double(1.234) refcount(3)
141: &double(1.234) refcount(2)
142: -- Iteration 13 --
143: double(-1.234) refcount(3)
144: &double(-1.234) refcount(2)
145: -- Iteration 14 --
146: double(-2) refcount(3)
147: &double(-2) refcount(2)
148: -- Iteration 15 --
149: double(2) refcount(3)
150: &double(2) refcount(2)
151: -- Iteration 16 --
152: double(-400010) refcount(3)
153: &double(-400010) refcount(2)
154: -- Iteration 17 --
155: double(400010) refcount(3)
156: &double(400010) refcount(2)
157: -- Iteration 18 --
158: double(6.99999989) refcount(3)
159: &double(6.99999989) refcount(2)
160: -- Iteration 19 --
161: double(-0.5) refcount(3)
162: &double(-0.5) refcount(2)
163: -- Iteration 20 --
164: double(0.567) refcount(3)
165: &double(0.567) refcount(2)
166: -- Iteration 21 --
167: double(-0.00067) refcount(3)
168: &double(-0.00067) refcount(2)
169: -- Iteration 22 --
170: double(-670) refcount(3)
171: &double(-670) refcount(2)
172: -- Iteration 23 --
173: double(1.0E-5) refcount(3)
174: &double(1.0E-5) refcount(2)
175: -- Iteration 24 --
176: double(-100000) refcount(3)
177: &double(-100000) refcount(2)
178: -- Iteration 25 --
179: double(100000) refcount(3)
180: &double(100000) refcount(2)
181: -- Iteration 26 --
182: double(1.0E-5) refcount(3)
183: &double(1.0E-5) refcount(2)
184: -- Iteration 27 --
185: string(0) "" refcount(3)
186: &string(0) "" refcount(2)
187: -- Iteration 28 --
188: string(0) "" refcount(3)
189: &string(0) "" refcount(2)
190: -- Iteration 29 --
191: string(1) " " refcount(3)
192: &string(1) " " refcount(2)
193: -- Iteration 30 --
194: string(1) " " refcount(3)
195: &string(1) " " refcount(2)
196: -- Iteration 31 --
197: string(1) "0" refcount(3)
198: &string(1) "0" refcount(2)
199: -- Iteration 32 --
200: string(1) "