summaryrefslogtreecommitdiff
path: root/Zend/tests/get_mangled_object_vars.phpt
blob: 735548579e24c4c4bec98ddcc5fc28a9644be4f9 (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
--TEST--
get_mangled_object_vars() function
--FILE--
<?php

class A {
    public $pub = 1;
    protected $prot = 2;
    private $priv = 3;
}
class B extends A {
    private $priv = 4;
}

$obj = new B;
$obj->dyn = 5;
$obj->{"6"} = 6;

var_export(get_mangled_object_vars($obj));
echo "\n";

class AO extends ArrayObject {
    private $priv = 1;
}

$ao = new AO(['x' => 'y']);
$ao->dyn = 2;
var_export(get_mangled_object_vars($ao));
echo "\n";
var_export((array) $ao);
echo "\n";

?>
--EXPECT--
array (
  '' . "\0" . 'B' . "\0" . 'priv' => 4,
  'pub' => 1,
  '' . "\0" . '*' . "\0" . 'prot' => 2,
  '' . "\0" . 'A' . "\0" . 'priv' => 3,
  'dyn' => 5,
  6 => 6,
)
array (
  '' . "\0" . 'AO' . "\0" . 'priv' => 1,
  'dyn' => 2,
)
array (
  'x' => 'y',
)