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