1--TEST-- 2References are not counted twice 3--FILE-- 4<?php 5 6$ref1 = 1; 7$ref2 = 2; 8 9$arr = [&$ref1, &$ref1, &$ref2, &$ref2]; 10var_dump(serialize($arr)); 11 12?> 13--EXPECT-- 14string(38) "a:4:{i:0;i:1;i:1;R:2;i:2;i:2;i:3;R:3;}" 15