c2ec1c97c9
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
34 linhas
464 B
PHP
34 linhas
464 B
PHP
<?php
|
|
|
|
class A {
|
|
function t($a, $arr) {
|
|
}
|
|
}
|
|
class B extends A {
|
|
function t($a, $arr) {
|
|
var_dump($a);
|
|
$arr['hello'] = $a;
|
|
var_dump($a);
|
|
}
|
|
}
|
|
function f() {
|
|
return new B();
|
|
}
|
|
function test() {
|
|
$v = 100;
|
|
$arr['hello'] = $v;
|
|
$a = new B();
|
|
$a->t($arr['hello'], $arr);
|
|
}
|
|
test();
|
|
$arr = array('hello' => 1);
|
|
$x = &$arr['hello'];
|
|
$arr['hello'] = $x;
|
|
var_dump($arr);
|
|
function test2(&$a, $b) {
|
|
$a = $b;
|
|
}
|
|
$v = 10;
|
|
test2($v, $v);
|
|
var_dump($v);
|