File tree Expand file tree Collapse file tree 2 files changed +113
-0
lines changed
Expand file tree Collapse file tree 2 files changed +113
-0
lines changed Original file line number Diff line number Diff line change 1+ --TEST--
2+ Parameter type 'mixed'
3+ --SKIPIF--
4+ <?php include (__DIR__ . '/../skipif.inc ' ); ?>
5+ --FILE--
6+ <?php
7+ $ code =<<<ZEP
8+ function test(mixed value) { }
9+ ZEP ;
10+
11+ $ ir = zephir_parse_file ($ code , '(eval code) ' );
12+ var_dump ($ ir );
13+ ?>
14+ --EXPECT--
15+ array(1) {
16+ [0]=>
17+ array(6) {
18+ ["type"]=>
19+ string(8) "function"
20+ ["name"]=>
21+ string(4) "test"
22+ ["parameters"]=>
23+ array(1) {
24+ [0]=>
25+ array(9) {
26+ ["type"]=>
27+ string(9) "parameter"
28+ ["name"]=>
29+ string(5) "value"
30+ ["const"]=>
31+ int(0)
32+ ["data-type"]=>
33+ string(5) "mixed"
34+ ["mandatory"]=>
35+ int(0)
36+ ["reference"]=>
37+ int(0)
38+ ["file"]=>
39+ string(11) "(eval code)"
40+ ["line"]=>
41+ int(1)
42+ ["char"]=>
43+ int(27)
44+ }
45+ }
46+ ["file"]=>
47+ string(11) "(eval code)"
48+ ["line"]=>
49+ int(1)
50+ ["char"]=>
51+ int(9)
52+ }
53+ }
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Function definition with void
3+ --SKIPIF--
4+ <?php include (__DIR__ . '/../skipif.inc ' ); ?>
5+ --FILE--
6+ <?php
7+ $ code =<<<ZEP
8+ function test() -> mixed { }
9+ ZEP ;
10+
11+ $ ir = zephir_parse_file ($ code , '(eval code) ' );
12+ var_dump ($ ir );
13+ ?>
14+ --EXPECT--
15+ array(1) {
16+ [0]=>
17+ array(6) {
18+ ["type"]=>
19+ string(8) "function"
20+ ["name"]=>
21+ string(4) "test"
22+ ["return-type"]=>
23+ array(6) {
24+ ["type"]=>
25+ string(11) "return-type"
26+ ["list"]=>
27+ array(1) {
28+ [0]=>
29+ array(6) {
30+ ["type"]=>
31+ string(21) "return-type-parameter"
32+ ["data-type"]=>
33+ string(5) "mixed"
34+ ["mandatory"]=>
35+ int(0)
36+ ["file"]=>
37+ string(11) "(eval code)"
38+ ["line"]=>
39+ int(1)
40+ ["char"]=>
41+ int(27)
42+ }
43+ }
44+ ["void"]=>
45+ int(0)
46+ ["file"]=>
47+ string(11) "(eval code)"
48+ ["line"]=>
49+ int(1)
50+ ["char"]=>
51+ int(27)
52+ }
53+ ["file"]=>
54+ string(11) "(eval code)"
55+ ["line"]=>
56+ int(1)
57+ ["char"]=>
58+ int(9)
59+ }
60+ }
You can’t perform that action at this time.
0 commit comments