Fix fbcufa.php in repo mode
[hiphop-php.git] / hphp / test / quick / fbcufa.php
blob72f4e59436a4904b5fd755ff17039f89499a59e5
1 <?php
2 $doc = __DIR__ . '/fbcufa.inc';
3 require_once 'fbcufa.inc';
4 function main() {
5 global $doc;
6 echo "--------------------\n";
7 $hnd = fb_call_user_func_async($doc, 'foo', array(1,2,3), 'blarg');
8 $rv = fb_end_user_func_async($hnd);
9 var_dump($rv);
10 echo "--------------------\n";
11 $hnd = fb_call_user_func_async($doc, 'C::bar', 42);
12 $rv = fb_end_user_func_async($hnd);
13 var_dump($rv);
14 echo "--------------------\n";
15 $hnd = fb_call_user_func_async($doc, array('C', 'bar'), 42);
16 $rv = fb_end_user_func_async($hnd);
17 var_dump($rv);
18 echo "--------------------\n";
19 $obj = new C;
20 $obj->blah = 789;
21 $hnd = fb_call_user_func_async($doc, array($obj, 'baz'), 73);
22 $rv = fb_end_user_func_async($hnd);
23 var_dump($rv);
24 echo "--------------------\n";
25 $hnd = fb_call_user_func_async($doc, 'doThrow');
26 $rv = null;
27 $caught = false;
28 try {
29 $rv = fb_end_user_func_async($hnd);
30 } catch (Exception $e) {
31 $caught = true;
33 if (!$caught) {
34 echo "Exception was not thrown as expected\n";
37 main();