1--TEST-- 2get_mangled_object_vars() function 3--FILE-- 4<?php 5 6#[AllowDynamicProperties] 7class A { 8 public $pub = 1; 9 protected $prot = 2; 10 private $priv = 3; 11} 12class B extends A { 13 private $priv = 4; 14} 15 16$obj = new B; 17$obj->dyn = 5; 18$obj->{"6"} = 6; 19 20var_export(get_mangled_object_vars($obj)); 21echo "\n"; 22 23#[AllowDynamicProperties] 24class AO extends ArrayObject { 25 private $priv = 1; 26} 27 28$ao = new AO(['x' => 'y']); 29$ao->dyn = 2; 30var_export(get_mangled_object_vars($ao)); 31echo "\n"; 32var_export((array) $ao); 33echo "\n"; 34 35?> 36--EXPECT-- 37array ( 38 'pub' => 1, 39 '' . "\0" . '*' . "\0" . 'prot' => 2, 40 '' . "\0" . 'A' . "\0" . 'priv' => 3, 41 '' . "\0" . 'B' . "\0" . 'priv' => 4, 42 'dyn' => 5, 43 6 => 6, 44) 45array ( 46 '' . "\0" . 'AO' . "\0" . 'priv' => 1, 47 'dyn' => 2, 48) 49array ( 50 'x' => 'y', 51) 52