this_in_extract.phpt 307 B

12345678910111213141516171819
  1. --TEST--
  2. $this re-assign in extract()
  3. --FILE--
  4. <?php
  5. function foo() {
  6. try {
  7. extract(["this"=>42, "a"=>24]);
  8. } catch (Error $e) {
  9. echo $e->getMessage(), "\n";
  10. }
  11. var_dump($a);
  12. }
  13. foo();
  14. ?>
  15. --EXPECTF--
  16. Cannot re-assign $this
  17. Warning: Undefined variable $a in %s on line %d
  18. NULL