File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
tests/functions/return-types Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 108108
109109 <dir name =" return-types" >
110110 <file name =" false.phpt" role =" test" />
111+ <file name =" float.phpt" role =" test" />
111112 <file name =" int.phpt" role =" test" />
112113 <file name =" mixed.phpt" role =" test" />
113114 </dir >
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Function definition with `float` return type
3+ --SKIPIF--
4+ <?php include (__DIR__ . '/../../skipif.inc ' ); ?>
5+ --FILE--
6+ <?php
7+ $ code =<<<ZEP
8+ function test() -> float { }
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(6) "double"
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