mirror of
https://github.com/php/php-src.git
synced 2024-12-13 20:05:26 +08:00
3b48c5a36f
This reverts commit fafe01b07b
.
See bug #72698, there is code using this behavior. Reverting for
PHP 7.0 *only*. The fix is still in PHP 7.1.
29 lines
483 B
PHP
29 lines
483 B
PHP
--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)
|