1
0
mirror of https://github.com/php/php-src.git synced 2026-04-01 13:12:16 +02:00
Files
archived-php-src/ext/standard/tests/strings/bug22224.phpt
2018-10-14 19:45:12 +02:00

32 lines
388 B
PHP

--TEST--
Bug #22224 (implode changes object references in array)
--INI--
error_reporting=0
--FILE--
<?php
class foo
{
function __toString()
{
return "Object";
}
}
$a = new foo();
$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) {
}
}