global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / intercept2.php
blob82a0b8f4558b7f41515f9bb77280681c95fafa6b
1 <?hh
3 /*
4 * Test intercepts where callsites have already been bound to the
5 * pre-intercept function.
6 */
8 function foo() {
9 var_dump(__METHOD__);
12 function bar() {
13 var_dump(__METHOD__);
16 function test() {
17 foo();
20 class C {
21 function __call($name, $args) {
22 var_dump(__METHOD__, $name, $args);
27 function swizzle($name, $obj, $args, $data, &$done) {
28 var_dump($name, $obj, $args, $data, $done);
29 $done = false;
32 function main() {
33 $c = new C();
34 for ($i = 0; $i < 3; $i++) {
35 test();
36 foo();
37 $c->snoot();
38 if ($i == 1) {
39 fb_intercept('foo', 'bar', false);
40 fb_intercept('C::__call', 'swizzle');
45 main();