Arquivos
hhvm/hphp/test/vm/fbcufa.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

38 linhas
1.0 KiB
PHP

<?php
$doc = dirname(__FILE__) . '/_fbcufa_init.php';
require_once $doc;
function main() {
global $doc;
echo "--------------------\n";
$hnd = fb_call_user_func_async($doc, 'foo', array(1,2,3), 'blarg');
$rv = fb_end_user_func_async($hnd);
var_dump($rv);
echo "--------------------\n";
$hnd = fb_call_user_func_async($doc, 'C::bar', 42);
$rv = fb_end_user_func_async($hnd);
var_dump($rv);
echo "--------------------\n";
$hnd = fb_call_user_func_async($doc, array('C', 'bar'), 42);
$rv = fb_end_user_func_async($hnd);
var_dump($rv);
echo "--------------------\n";
$obj = new C;
$obj->blah = 789;
$hnd = fb_call_user_func_async($doc, array($obj, 'baz'), 73);
$rv = fb_end_user_func_async($hnd);
var_dump($rv);
echo "--------------------\n";
$hnd = fb_call_user_func_async($doc, 'doThrow');
$rv = null;
$caught = false;
try {
$rv = fb_end_user_func_async($hnd);
} catch (Exception $e) {
$caught = true;
}
if (!$caught) {
echo "Exception was not thrown as expected\n";
}
}
main();