1--TEST--
2Test octdec() function : usage variations - different data types as $octal_string arg
3--INI--
4precision=14
5--FILE--
6<?php
7/* Prototype  : number octdec  ( string $octal_string  )
8 * Description: Returns the decimal equivalent of the octal number represented by the octal_string  argument.
9 * Source code: ext/standard/math.c
10 */
11
12echo "*** Testing octdec() : usage variations ***\n";
13//get an unset variable
14$unset_var = 10;
15unset ($unset_var);
16
17// heredoc string
18$heredoc = <<<EOT
19abc
20xyz
21EOT;
22
23// get a resource variable
24$fp = fopen(__FILE__, "r");
25
26$inputs = array(
27       // int data
28/*1*/  0,
29       1,
30       12345,
31       -2345,
32       4294967295,  // largest decimal
33       4294967296,
34
35       // float data
36/*7*/  10.5,
37       -10.5,
38       12.3456789000e10,
39       12.3456789000E-10,
40       .5,
41
42       // null data
43/*12*/ NULL,
44       null,
45
46       // boolean data
47/*14*/ true,
48       false,
49       TRUE,
50       FALSE,
51
52       // empty data
53/*18*/ "",
54       '',
55       array(),
56
57       // string data
58/*21*/ "abcxyz",
59       'abcxyz',
60       $heredoc,
61
62       // undefined data
63/*24*/ @$undefined_var,
64
65       // unset data
66/*25*/ @$unset_var,
67
68       // resource variable
69/*26*/ $fp
70);
71
72// loop through each element of $inputs to check the behaviour of octdec()
73$iterator = 1;
74foreach($inputs as $input) {
75	echo "\n-- Iteration $iterator --\n";
76	var_dump(octdec($input));
77	$iterator++;
78};
79fclose($fp);
80?>
81---Done---
82--EXPECTF--
83*** Testing octdec() : usage variations ***
84
85-- Iteration 1 --
86int(0)
87
88-- Iteration 2 --
89int(1)
90
91-- Iteration 3 --
92int(5349)
93
94-- Iteration 4 --
95
96Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
97int(1253)
98
99-- Iteration 5 --
100
101Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
102int(1134037)
103
104-- Iteration 6 --
105
106Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
107int(1134038)
108
109-- Iteration 7 --
110
111Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
112int(69)
113
114-- Iteration 8 --
115
116Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
117int(69)
118
119-- Iteration 9 --
120
121Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
122int(175304192)
123
124-- Iteration 10 --
125
126Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
127int(342391)
128
129-- Iteration 11 --
130
131Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
132int(5)
133
134-- Iteration 12 --
135int(0)
136
137-- Iteration 13 --
138int(0)
139
140-- Iteration 14 --
141int(1)
142
143-- Iteration 15 --
144int(0)
145
146-- Iteration 16 --
147int(1)
148
149-- Iteration 17 --
150int(0)
151
152-- Iteration 18 --
153int(0)
154
155-- Iteration 19 --
156int(0)
157
158-- Iteration 20 --
159
160Notice: Array to string conversion in %s on line %d
161
162Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
163int(0)
164
165-- Iteration 21 --
166
167Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
168int(0)
169
170-- Iteration 22 --
171
172Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
173int(0)
174
175-- Iteration 23 --
176
177Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
178int(0)
179
180-- Iteration 24 --
181int(0)
182
183-- Iteration 25 --
184int(0)
185
186-- Iteration 26 --
187
188Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d
189int(5)
190---Done---
191