bug79108.phpt 406 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug #79108: Referencing argument in a function makes it a reference in the stack trace
  3. --FILE--
  4. <?php
  5. function test(string $val) {
  6. $a = &$val;
  7. hackingHere();
  8. print_r($val);
  9. }
  10. function hackingHere() {
  11. // we're able to modify the $val from here, even though the arg was not a reference
  12. debug_backtrace()[1]['args'][0] = 'Modified';
  13. }
  14. test('Original');
  15. ?>
  16. --EXPECT--
  17. Original