summaryrefslogtreecommitdiff
path: root/Zend/tests/unexpected_ref_bug.phpt
blob: a4e74e7a670b6dfccd279eea67ccfc42d4ffbf2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
Crash when function parameter modified via unexpected reference
--FILE--
<?php
class Test {
    public function __toString() {
        global $my_var;
        $my_var = 0;
        return ",";
    }
}
$my_var = str_repeat("A",64);
$data = call_user_func_array("explode",array(new Test(), &$my_var));
$my_var=array(1,2,3);
$data = call_user_func_array("implode",array(&$my_var, new Test()));
echo "Done.\n";
?>
--EXPECTF--
Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in %s on line %d
Done.