Arquivos
hhvm/hphp/test/slow/switch_statement/1758.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

27 linhas
403 B
PHP

<?php
switch ($_POST) {
case array(): echo 'empty array';
break;
case $_GET: echo 'get';
break;
default: echo 'default';
}
switch ($GLOBALS) {
case array(): echo 'empty array';
break;
default: echo 'default';
}
function ret_true($x) {
return true;
}
switch ($GLOBALS) {
case ret_true($GLOBALS['foo'] = 10): echo '1';
break;
case array();
echo '2';
break;
default: echo '3';
}
var_dump($foo);