summaryrefslogtreecommitdiff
path: root/Zend/tests/call_user_func_006.phpt
blob: e45c81dc108bf193cd0c28b09e3678cd1fbfb5d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
call_user_func() should error on reference arguments
--FILE--
<?php

namespace Foo;

function bar(&$ref) {
    $ref = 24;
}

$x = 42;
$ref =& $x;
\call_user_func('Foo\bar', $x);
var_dump($x);

$y = 42;
$ref =& $y;
call_user_func('Foo\bar', $y);
var_dump($y);

?>
--EXPECTF--
Warning: Foo\bar(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
int(42)

Warning: Foo\bar(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
int(42)