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
24 linhas
299 B
PHP
24 linhas
299 B
PHP
<?php
|
|
|
|
class A {
|
|
var $a = 1;
|
|
var $b = 2;
|
|
var $c = 3;
|
|
var $d = 4;
|
|
public function __construct() {
|
|
$this->a = 1;
|
|
$this->b = 2;
|
|
$this->c = 3;
|
|
$this->d = 4;
|
|
}
|
|
}
|
|
;
|
|
function f() {
|
|
$obj = new A();
|
|
foreach ($obj as $key => &$val) {
|
|
$val = 5;
|
|
}
|
|
var_dump($obj);
|
|
}
|
|
f();
|