Arquivos
hhvm/hphp/test/slow/object_assignment/774.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

34 linhas
513 B
PHP

<?php
class foo {
public function __construct() {
$this->val = 1;
}
function bar() {
echo $this->val;
$ref = &$this;
$ref->val = 2;
echo $this->val;
$ref2 = $this;
$ref2->val = 3;
echo $this->val;
$x = new foo();
echo $x->val;
$ref3 = &$x;
$ref3->val = 4;
echo $x->val;
$ref4 = $x;
$ref4->val = 5;
echo $x->val;
}
var $val;
}
$x = new foo();
$x->bar();
$ref5 = $x;
$ref5->val = 6;
echo $x->val;
$ref6 = &$x;
$ref6->val = 7;
echo $x->val;