Arquivos
hhvm/hphp/test/slow/compilation/1314.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

28 linhas
726 B
PHP

<?php
function foo($a,$b,$c,$d) {
return implode($a,$b);
}
function bar($values, $parent_fields) {
$full_name = implode('___', $parent_fields);
$body = '';
$body .= '<div>';
$body .= '<table id=' . 'bar_' . $full_name . ' border=1>';
$item_num = 0;
if (null !== $values) {
foreach($values as $val) {
$row_id = 'tr_sentrylist_' . $item_num . '_' . $full_name;
$body .= '<tr id=' . $row_id . '>';
$body .= '<td>';
$body .= foo($item_num, 0, $val, $parent_fields);
$body .= '</td>';
$body .= '<td>';
$body .= foo($item_num, $full_name, 0, 0);
$body .= '</td>';
$body .= '</tr>';
$item_num += 1;
}
}
$body .= '</table>';
}