blob: 16a59bcf5ba57b1aa82181ff52108ba763c97a31 (
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: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
int(42)
Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
int(42)
|