Arquivos
hhvm/hphp/test/quick/obj-string-throw.php
T
Jordan DeLong 4b8304f07a Remove try/catch in conv{Obj,Res}ToStrHelper
We have a catch trace that does a SpillStack for both of
these helpers.  Incidentally, zend raises a fatal if you try to throw
in this situation.

Differential Revision: D944079
2013-08-29 11:58:34 -07:00

13 linhas
224 B
PHP

<?php
class foo {
public function __destruct() { echo "dtor\n"; }
public function __toString() { throw new Exception("asd"); }
}
function main() {
echo (string)(new foo());
}
try { main(); } catch (Exception $x) {}