this_in_parse_str.phpt 481 B

12345678910111213141516171819
  1. --TEST--
  2. $this re-assign in parse_str()
  3. --FILE--
  4. <?php
  5. function foo() {
  6. parse_str("this=42");
  7. var_dump($this);
  8. }
  9. foo();
  10. ?>
  11. --EXPECTF--
  12. Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d
  13. Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_in_parse_str.php:3
  14. Stack trace:
  15. #0 %sthis_in_parse_str.php(3): parse_str('this=42')
  16. #1 %sthis_in_parse_str.php(6): foo()
  17. #2 {main}
  18. thrown in %sthis_in_parse_str.php on line 3