Arquivos
hhvm/hphp/test/slow/object_property_expression/798.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

35 linhas
576 B
PHP

<?php
class Y {
}
class X {
public $a;
function __construct() {
$this->a = array('x' => new Y);
}
function bar() {
var_dump('bar');
$this->qq = new Y;
$this->qq->x = $this->qq->y = 1;
return $this->qq;
}
}
function foo() {
var_dump('foo');
return 'foo';
}
function test($x, $a, $s) {
$t = &$s->t;
unset($x->bar()->x);
unset($x->q->r->s->${
foo()}
);
unset($x->y->a->b->c);
unset($x->a['x']->y->a->b->c);
unset($a['a']['y'][foo()]);
unset($a['b']->y->z);
unset($a->c->d);
var_dump($x, $a, $s);
}
test(new X, array(), false);