Disallow declarations outside of the global scope.
[hiphop-php.git] / hphp / test / slow / inout / tuple / tests / fb-intercept-wrapper.php
blob271a08240e795faf84119b45c3cd41d9f034eb15
1 <?hh // decl
3 class Foo {
4 static function bar(int $x, inout bool $y, inout string $z) {
5 var_dump('inside bar');
6 $y = false;
7 $z = 'hello-world';
8 return $x;
12 function meep(&$f, $g, &$r) {
13 var_dump('inside meep');
14 $f = 'apple';
15 $r = 'orange';
16 return $g;
19 function io_intercept($name, $obj_or_cls, inout $args, $ctx, inout $done) {
20 var_dump($name);
21 var_dump($args);
22 $done = false;
25 function main() {
26 fb_intercept('meep', 'io_intercept', true);
27 fb_intercept('Foo::bar', 'io_intercept', true);
28 $a = 1; $b = true; $c = 'c';
29 Foo::bar($a, &$b, &$c);
31 $a = 1; $b = true; $c = 'c';
32 meep(inout $a, $b, inout $c);
35 main();