/4.0/Testing/Tests/Arrays/array_unique.php
PHP | 21 lines | 14 code | 4 blank | 3 comment | 0 complexity | c8d1a26e8316854076199a4eba333a9b MD5 | raw file
Possible License(s): CPL-1.0, GPL-2.0, CC-BY-SA-3.0, MPL-2.0-no-copyleft-exception, Apache-2.0
- [expect php]
- [file]
- <?
-
- function test(&$a)
- {
- $arr = array( 4,3,4,3,2,1,2,1,4,3,2,1 );
- $arr[] = &$a;
- $arr[] = $a;
- var_dump($arr);
-
- // check whether values are preserved in the same order
- // without duplicities
- // preserving the first unique entry
- var_dump(array_unique($arr));
- }
-
- $x = 5;
- test($x);
-
- ?>