mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
34 lines
414 B
PHP
34 lines
414 B
PHP
--TEST--
|
|
Force pass-by-reference to __call
|
|
--FILE--
|
|
<?php
|
|
class C
|
|
{
|
|
function __call($name, $values)
|
|
{
|
|
$values[0][0] = 'changed';
|
|
}
|
|
}
|
|
|
|
$a = array('original');
|
|
|
|
$b = array('original');
|
|
$hack =& $b[0];
|
|
|
|
$c = new C;
|
|
$c->f($a);
|
|
$c->f($b);
|
|
|
|
var_dump($a, $b);
|
|
?>
|
|
--EXPECTF--
|
|
array(1) {
|
|
[0]=>
|
|
string(8) "original"
|
|
}
|
|
array(1) {
|
|
[0]=>
|
|
&string(7) "changed"
|
|
}
|
|
|