summaryrefslogtreecommitdiff
path: root/ext/spl/tests/arrayObject_asort_basic2.phpt
blob: 6f2e8509eff86b5f37f5bd458dbf9b363eceff33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--TEST--
SPL: Test ArrayObject::asort() function : basic functionality with object based store
--FILE--
<?php
/* Prototype  : int ArrayObject::asort()
 * Description: proto int ArrayIterator::asort()
 * Sort the entries by values.
 * Source code: ext/spl/spl_array.c
 * Alias to functions:
 */

echo "*** Testing ArrayObject::asort() : basic functionality ***\n";
Class C {
	public $prop1 = 'x';
	public $prop2 = 'z';
	private $prop3 = 'a';
	public $prop4 = 'x';
}

$c = new C;
$ao1 = new ArrayObject($c);
var_dump($ao1->asort());
var_dump($ao1, $c);
?>
===DONE===
--EXPECTF--
*** Testing ArrayObject::asort() : basic functionality ***
bool(true)
object(ArrayObject)#2 (1) {
  ["storage":"ArrayObject":private]=>
  object(C)#1 (4) {
    ["prop3":"C":private]=>
    string(1) "a"
    ["prop1"]=>
    string(1) "x"
    ["prop4"]=>
    string(1) "x"
    ["prop2"]=>
    string(1) "z"
  }
}
object(C)#1 (4) {
  ["prop3":"C":private]=>
  string(1) "a"
  ["prop1"]=>
  string(1) "x"
  ["prop4"]=>
  string(1) "x"
  ["prop2"]=>
  string(1) "z"
}
===DONE===