Arquivos
hhvm/hphp/test/slow/reflection/1331.php
T
Paul Tarjan c2ec1c97c9 sortof format slow tests
A poor man's formatter since I didn't like any of the other ones I found. The original C++ source sometimes put newlines and sometimes not.

Codemods:

    codemod '([;{}])([^\n])' '\1\n\2'
    codemod -m '\s*<\?php\s+' '<?php\n\n'
    codemod '\t' '  '

I hand-fixed all the failing tests
2013-05-30 17:32:57 -07:00

23 linhas
542 B
PHP

<?php
class B {
public function f($a) {
return 'ok'.$a;
}
}
class A extends B {
public $p = 'g';
}
$obj = new A();
var_dump(get_class($obj));
var_dump(get_parent_class($obj));
var_dump(is_a($obj, 'b'));
var_dump(is_subclass_of($obj, 'b'));
var_dump(method_exists($obj, 'f'));
var_dump(method_exists('A', 'f'));
var_dump(is_callable(array($obj, 'f')));
var_dump(is_callable(array('A', 'f')));
var_dump(get_object_vars($obj));
var_dump(call_user_method('f', $obj, 'blah'));
var_dump(call_user_method_array('f', $obj, array('blah')));