Handle this typehints
[hiphop-php.git] / hphp / test / slow / get_defined_functions-IDLvsHNI.php
bloba379525256161144e95b0286263e70d3d20e3a26
1 <?php
2 # Check for at least one HNI based function in get_defined_functions()
3 # and at least one IDL based function.
5 # Note to future self: One day (soon) this test will fail
6 # and Simon shall weep, for there are no more IDLs to convert.
8 $foundidl = false;
9 $foundhni = false;
11 foreach(get_defined_functions()['internal'] as $f) {
12 $ishni = false;
13 $rf = new ReflectionFunction($f);
14 if ($attrs = $rf->getAttributes()) {
15 foreach ($attrs as $name => $attr) {
16 if (!strcasecmp($name, '__Native')) {
17 $ishni = true;
18 break;
22 if (!$ishni) {
23 $foundidl = true;
24 } else {
25 $foundhni = true;
28 if ($foundhni && $foundidl) break;
30 var_dump($foundhni);
31 var_dump($foundidl);