Fix bug in way function types are serialized to the Code Model.
[hiphop-php.git] / hphp / test / ext / get_code_model_for.php
blobd794a9d9b8ece1c8f787e802a16fd8700a79f488
1 <?php
2 $code = '<?php
3 $global = 1;
5 function foo((function(): int) $x) {
6 return $x + 1;
8 ';
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";