Arquivos
hhvm/hphp/test/quick/intercept2.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07:00

47 linhas
669 B
PHP

<?php
/*
* Test intercepts where callsites have already been bound to the
* pre-intercept function.
*/
function foo() {
var_dump(__METHOD__);
}
function bar() {
var_dump(__METHOD__);
}
function test() {
foo();
}
class C {
function __call($name, $args) {
var_dump(__METHOD__, $name, $args);
}
}
function swizzle($name, $obj, $args, $data, &$done) {
var_dump($name, $obj, $args, $data, $done);
$done = false;
}
function main() {
$c = new C();
for ($i = 0; $i < 3; $i++) {
test();
foo();
$c->snoot();
if ($i == 1) {
fb_intercept('foo', 'bar', false);
fb_intercept('C::__call', 'swizzle');
}
}
}
main();