this_reassign.phpt 305 B

1234567891011121314151617
  1. --TEST--
  2. $this re-assign
  3. --FILE--
  4. <?php
  5. function foo() {
  6. $a = "this";
  7. $$a = 0;
  8. var_dump($$a);
  9. }
  10. foo();
  11. ?>
  12. --EXPECTF--
  13. Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_reassign.php:4
  14. Stack trace:
  15. #0 %sthis_reassign.php(7): foo()
  16. #1 {main}
  17. thrown in %sthis_reassign.php on line 4