php-src/ext/standard/tests/strings/bug22224.phpt

32 lines
388 B
Plaintext
Raw Normal View History

--TEST--
Bug #22224 (implode changes object references in array)
--INI--
error_reporting=0
--FILE--
<?php
2006-05-25 10:46:53 +00:00
class foo
{
function __toString()
{
return "Object";
}
}
$a = new foo();
2018-10-14 15:45:48 +00:00
$arr = array(0=>&$a, 1=>&$a);
var_dump(implode(",",$arr));
var_dump($arr)
?>
--EXPECTF--
string(13) "Object,Object"
array(2) {
[0]=>
&object(foo)#%d (0) {
}
[1]=>
&object(foo)#%d (0) {
}
}