repo.or.cz
/
hiphop-php.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix bug in way function types are serialized to the Code Model.
[hiphop-php.git]
/
hphp
/
test
/
ext
/
get_code_model_for.php
blob
d794a9d9b8ece1c8f787e802a16fd8700a79f488
1
<
?php
2
$code
=
'<?php
3
$global
= 1;
4
5
function foo((function(): int)
$x
) {
6
return
$x
+ 1;
7
}
8
'
;
9
10
$serializedAST
=
HH\CodeModel\
get_code_model_for
(
$code
);
11
$ast
=
unserialize
(
$serializedAST
);
12
$formatter
=
new
HH\CodeModel\
CodeModelToPHP
();
13
echo
$formatter
->
visitScript
(
$ast
,
"php"
);
14
echo
"
\n
"
;