1--TEST--
2Test natcasesort() function : usage variations - recursive arrays
3--FILE--
4<?php
5/* Prototype  : bool natcasesort(array &$array_arg)
6 * Description: Sort an array using case-insensitive natural sort
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Pass natcasesort() an infinitely recursive array to test how it is re-ordered
12 */
13
14echo "*** Testing natcasesort() : usage variations ***\n";
15
16$array = array (1, 3.00, 'zero', '2');
17$array[] = &$array;
18var_dump($array);
19
20var_dump(@natcasesort($array));
21var_dump($array);
22
23echo "Done";
24?>
25--EXPECTF--
26*** Testing natcasesort() : usage variations ***
27array(5) {
28  [0]=>
29  int(1)
30  [1]=>
31  float(3)
32  [2]=>
33  string(4) "zero"
34  [3]=>
35  string(1) "2"
36  [4]=>
37  &array(5) {
38    [0]=>
39    int(1)
40    [1]=>
41    float(3)
42    [2]=>
43    string(4) "zero"
44    [3]=>
45    string(1) "2"
46    [4]=>
47    *RECURSION*
48  }
49}
50bool(true)
51array(5) {
52  [0]=>
53  int(1)
54  [3]=>
55  string(1) "2"
56  [1]=>
57  float(3)
58  [4]=>
59  &array(5) {
60    [0]=>
61    int(1)
62    [3]=>
63    string(1) "2"
64    [1]=>
65    float(3)
66    [4]=>
67    *RECURSION*
68    [2]=>
69    string(4) "zero"
70  }
71  [2]=>
72  string(4) "zero"
73}
74Done
75