Arquivos
hhvm/hphp/test/slow/exceptions/65.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

37 linhas
538 B
PHP

<?php
error_reporting(-1);
set_error_handler('handle');
function handle() {
throw new exception;
}
function foo($a,$b=null) {
return $a;
}
function test1() {
if (foo(0)) $a=1;
$x = new StdClass;
return $a;
}
function test2() {
if (foo(0)) $a=1;
return $a | new StdClass;
}
function test3() {
if (foo(0)) $a=1;
$x = new StdClass;
return $a::foo;
}
function test($f) {
try {
$f();
}
catch (Exception $e) {
var_dump($f.':Caught');
}
}
test('test1');
test('test2');
test('test3');
var_dump('not reached');