xref: /PHP-Parser/test/code/parser/expr/cast.test (revision 9a5d5c11)
1Casts
2-----
3<?php
4(array)   $a;
5(bool)    $a;
6(boolean) $a;
7(real)    $a;
8(double)  $a;
9(float)   $a;
10(int)     $a;
11(integer) $a;
12(object)  $a;
13(string)  $a;
14(unset)   $a;
15-----
16array(
17    0: Stmt_Expression(
18        expr: Expr_Cast_Array(
19            expr: Expr_Variable(
20                name: a
21            )
22        )
23    )
24    1: Stmt_Expression(
25        expr: Expr_Cast_Bool(
26            expr: Expr_Variable(
27                name: a
28            )
29        )
30    )
31    2: Stmt_Expression(
32        expr: Expr_Cast_Bool(
33            expr: Expr_Variable(
34                name: a
35            )
36        )
37    )
38    3: Stmt_Expression(
39        expr: Expr_Cast_Double(
40            expr: Expr_Variable(
41                name: a
42            )
43        )
44    )
45    4: Stmt_Expression(
46        expr: Expr_Cast_Double(
47            expr: Expr_Variable(
48                name: a
49            )
50        )
51    )
52    5: Stmt_Expression(
53        expr: Expr_Cast_Double(
54            expr: Expr_Variable(
55                name: a
56            )
57        )
58    )
59    6: Stmt_Expression(
60        expr: Expr_Cast_Int(
61            expr: Expr_Variable(
62                name: a
63            )
64        )
65    )
66    7: Stmt_Expression(
67        expr: Expr_Cast_Int(
68            expr: Expr_Variable(
69                name: a
70            )
71        )
72    )
73    8: Stmt_Expression(
74        expr: Expr_Cast_Object(
75            expr: Expr_Variable(
76                name: a
77            )
78        )
79    )
80    9: Stmt_Expression(
81        expr: Expr_Cast_String(
82            expr: Expr_Variable(
83                name: a
84            )
85        )
86    )
87    10: Stmt_Expression(
88        expr: Expr_Cast_Unset(
89            expr: Expr_Variable(
90                name: a
91            )
92        )
93    )
94)
95