Arquivos
hhvm/hphp/test/slow/static_statement/1407.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

118 linhas
1.6 KiB
PHP

<?php
static $a = 1, $b = 2;
static $c = 1;
static $d = 1;
static $e = 1;
static $f = 1;
static $g = 1;
static $h = 1;
static $i = 1;
static $i = 2;
if (false) {
static $a = 2;
static $b = 3;
static $c = 2;
static $g;
static $i;
$e = 2;
}
else {
static $d = 2;
static $h;
$f = 2;
}
echo $a;
echo $b;
echo $c;
echo $d;
echo $e;
echo $f;
echo $g;
echo $h;
echo $i;
function f() {
static $a = 1, $b = 2;
static $c = 1;
static $d = 1;
static $e = 1;
static $f = 1;
static $g = 1;
static $h = 1;
static $i = 1;
static $i = 2;
if (false) {
static $a = 2;
static $b = 3;
static $c = 2;
static $g;
static $i;
$e = 2;
}
else {
static $d = 2;
static $h;
$f = 2;
}
echo $a;
echo $b;
echo $c;
echo $d;
echo $e;
echo $f;
echo $g;
echo $h;
echo $i;
}
f();
class foo {
static $a = 1, $b = 2;
static $c = 1;
static $d = 1;
static $e = 1;
static $f = 1;
function bar() {
static $a = 1, $b = 2;
static $c = 1;
static $d = 1;
static $e = 1;
static $f = 1;
static $g = 1;
static $h = 1;
static $i = 1;
static $i = 2;
if (false) {
static $a = 2;
static $b = 3;
static $c = 2;
static $g;
static $i;
$e = 2;
}
else {
static $d = 2;
static $h;
$f = 2;
}
echo foo::$a;
echo foo::$b;
echo foo::$c;
echo foo::$d;
echo foo::$e;
echo foo::$f;
echo $a;
echo $b;
echo $c;
echo $d;
echo $e;
echo $f;
echo $g;
echo $h;
echo $i;
}
}
echo foo::$a;
echo foo::$b;
$v = new foo;
$v->bar();