Fix issue with calling a unique, non-persistent method
[hiphop-php.git] / hphp / test / slow / hhbbc / dce_004.php
blob8b86fbc3981e21dbe3691c24cc1271d1ae717a00
1 <?php
3 class str {}
4 class str1 extends str { public function __toString() { return "a"; } }
5 class str2 extends str {
6 public function __toString() { throw new Exception('a'); }
9 function bar(str $k) {
10 $tmp = 54;
11 try {
12 $y = $k->__toString();
13 $tmp = 2;
14 } catch (Exception $x) {
15 var_dump($tmp);
17 var_dump($tmp);
20 bar(new str1);
21 bar(new str2);