this_in_mb_parse_str.phpt 596 B

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