this_in_catch.phpt 309 B

123456789101112131415161718
  1. --TEST--
  2. $this in catch
  3. --FILE--
  4. <?php
  5. class C {
  6. function foo() {
  7. try {
  8. throw new Exception();
  9. } catch (Exception $this) {
  10. }
  11. var_dump($this);
  12. }
  13. }
  14. $obj = new C;
  15. $obj->foo();
  16. ?>
  17. --EXPECTF--
  18. Fatal error: Cannot re-assign $this in %sthis_in_catch.php on line 6