Arquivos
hhvm/hphp/test/quick/constructor_throw.php
T
Mark Williams b28254c8f2 Fix a crash if an exception is thrown in a constructor's surprise check
The unwinder assumed that if the actrec's constructor flag
was set, then there must be a $this. But the $this is cleared during
the return sequence.
2013-04-22 14:43:48 -07:00

22 linhas
284 B
PHP

<?php
class X {
function __construct() {
}
}
function handler($kind, $name) {
if ($kind == 'exit' && $name == 'X::__construct') throw new Exception;
}
function test() {
fb_setprofile('handler');
try {
new X;
} catch (Exception $e) {
echo "ok\n";
}
}
test();