Now properties are ordered according to their layout in zend_object structure.
}
Child::__construct
array(3) {
- ["Baz"]=>
- int(4)
["Foo"]=>
int(1)
["Bar"]=>
int(2)
+ ["Baz"]=>
+ int(4)
}
array(1) {
["Foo"]=>
?>
--EXPECTF--
object(SubclassA)#%d (2) {
- ["hello":"SubclassA":private]=>
- int(0)
["hello":"BaseWithPropA":private]=>
int(0)
+ ["hello":"SubclassA":private]=>
+ int(0)
}
object(SubclassB)#%d (2) {
- ["hello":"SubclassB":private]=>
- int(0)
["hello":"BaseWithTPropB":private]=>
int(0)
+ ["hello":"SubclassB":private]=>
+ int(0)
}
NULL
NULL
object(c)#1 (6) {
- ["prop1"]=>
- int(1)
- ["prop2":protected]=>
- int(2)
["prop3":"a":private]=>
int(3)
["prop4":"a":private]=>
int(4)
+ ["prop1"]=>
+ int(1)
+ ["prop2":protected]=>
+ int(2)
["prop5"]=>
int(5)
["prop6"]=>
?>
--EXPECT--
array (
- '' . "\0" . 'B' . "\0" . 'priv' => 4,
'pub' => 1,
'' . "\0" . '*' . "\0" . 'prot' => 2,
'' . "\0" . 'A' . "\0" . 'priv' => 3,
+ '' . "\0" . 'B' . "\0" . 'priv' => 4,
'dyn' => 5,
6 => 6,
)
var_dump($a < $b);
?>
--EXPECT--
-bool(false)
-bool(false)
+bool(true)
+bool(true)
?>
--EXPECT--
object(SubclassClassicInheritance)#1 (2) {
- ["hello":"SubclassClassicInheritance":private]=>
- int(0)
["hello":"BaseWithPropA":private]=>
int(0)
+ ["hello":"SubclassClassicInheritance":private]=>
+ int(0)
}
object(SubclassA)#2 (2) {
- ["hello":"SubclassA":private]=>
- int(0)
["hello":"BaseWithPropA":private]=>
int(0)
+ ["hello":"SubclassA":private]=>
+ int(0)
}
object(SubclassB)#3 (2) {
- ["hello":"SubclassB":private]=>
- int(0)
["hello":"BaseWithTPropB":private]=>
int(0)
+ ["hello":"SubclassB":private]=>
+ int(0)
}
if (!zobj->properties) {
zend_property_info *prop_info;
zend_class_entry *ce = zobj->ce;
- uint32_t flags = 0;
+ int i;
zobj->properties = zend_new_array(ce->default_properties_count);
if (ce->default_properties_count) {
zend_hash_real_init_mixed(zobj->properties);
- ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
- if (!(prop_info->flags & ZEND_ACC_STATIC)) {
- flags |= prop_info->flags;
+ for (i = 0; i < ce->default_properties_count; i++) {
+ prop_info = ce->properties_info_table[i];
- if (UNEXPECTED(Z_TYPE_P(OBJ_PROP(zobj, prop_info->offset)) == IS_UNDEF)) {
- HT_FLAGS(zobj->properties) |= HASH_FLAG_HAS_EMPTY_IND;
- }
-
- _zend_hash_append_ind(zobj->properties, prop_info->name,
- OBJ_PROP(zobj, prop_info->offset));
+ if (!prop_info) {
+ continue;
}
- } ZEND_HASH_FOREACH_END();
- if (flags & ZEND_ACC_CHANGED) {
- while (ce->parent && ce->parent->default_properties_count) {
- ce = ce->parent;
- ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
- if (prop_info->ce == ce &&
- !(prop_info->flags & ZEND_ACC_STATIC) &&
- (prop_info->flags & ZEND_ACC_PRIVATE)) {
- zval zv;
-
- if (UNEXPECTED(Z_TYPE_P(OBJ_PROP(zobj, prop_info->offset)) == IS_UNDEF)) {
- HT_FLAGS(zobj->properties) |= HASH_FLAG_HAS_EMPTY_IND;
- }
-
- ZVAL_INDIRECT(&zv, OBJ_PROP(zobj, prop_info->offset));
- zend_hash_add(zobj->properties, prop_info->name, &zv);
- }
- } ZEND_HASH_FOREACH_END();
+
+ if (UNEXPECTED(Z_TYPE_P(OBJ_PROP(zobj, prop_info->offset)) == IS_UNDEF)) {
+ HT_FLAGS(zobj->properties) |= HASH_FLAG_HAS_EMPTY_IND;
}
+
+ _zend_hash_append_ind(zobj->properties, prop_info->name,
+ OBJ_PROP(zobj, prop_info->offset));
}
}
}
}
if (!zobj1->properties && !zobj2->properties) {
zend_property_info *info;
+ int i;
if (!zobj1->ce->default_properties_count) {
return 0;
}
Z_PROTECT_RECURSION_P(o1);
- ZEND_HASH_FOREACH_PTR(&zobj1->ce->properties_info, info) {
- zval *p1 = OBJ_PROP(zobj1, info->offset);
- zval *p2 = OBJ_PROP(zobj2, info->offset);
+ for (i = 0; i < zobj1->ce->default_properties_count; i++) {
+ zval *p1, *p2;
+
+ info = zobj1->ce->properties_info_table[i];
- if (info->flags & ZEND_ACC_STATIC) {
+ if (!info) {
continue;
}
+ p1 = OBJ_PROP(zobj1, info->offset);
+ p2 = OBJ_PROP(zobj2, info->offset);
+
if (Z_TYPE_P(p1) != IS_UNDEF) {
if (Z_TYPE_P(p2) != IS_UNDEF) {
int ret;
return 1;
}
}
- } ZEND_HASH_FOREACH_END();
+ }
Z_UNPROTECT_RECURSION_P(o1);
return 0;
string(13) "Europe/London"
}
object(DateTimeZoneExt2)#%d (6) {
- ["property3"]=>
- bool(true)
- ["property4"]=>
- float(10.5)
["property1"]=>
int(99)
["property2"]=>
string(5) "Hello"
+ ["property3"]=>
+ bool(true)
+ ["property4"]=>
+ float(10.5)
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/London"
}
object(DateTimeZoneExt2)#%d (6) {
- ["property3"]=>
- bool(true)
- ["property4"]=>
- float(10.5)
["property1"]=>
int(99)
["property2"]=>
string(5) "Hello"
+ ["property3"]=>
+ bool(true)
+ ["property4"]=>
+ float(10.5)
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "GMT"
}
object(DateTimeExt2)#%d (7) {
- ["property3"]=>
- bool(true)
- ["property4"]=>
- float(10.5)
["property1"]=>
int(99)
["property2"]=>
string(5) "Hello"
+ ["property3"]=>
+ bool(true)
+ ["property4"]=>
+ float(10.5)
["date"]=>
string(26) "2009-02-03 12:34:41.000000"
["timezone_type"]=>
string(3) "GMT"
}
object(DateTimeExt2)#%d (7) {
- ["property3"]=>
- bool(true)
- ["property4"]=>
- float(10.5)
["property1"]=>
int(99)
["property2"]=>
string(5) "Hello"
+ ["property3"]=>
+ bool(true)
+ ["property4"]=>
+ float(10.5)
["date"]=>
string(26) "2009-02-03 12:34:41.000000"
["timezone_type"]=>
string(23) "Hierarchy Request Error"
["string":"Exception":private]=>
string(0) ""
+ ["code"]=>
+ int(3)
["file":protected]=>
string(%d) "%sdom003.php"
["line":protected]=>
}
["previous":"Exception":private]=>
NULL
- ["code"]=>
- int(3)
}
--- Don't catch exception with try/catch
string(20) "Wrong Document Error"
["string":"Exception":private]=>
string(0) ""
+ ["code"]=>
+ int(4)
["file":protected]=>
string(%d) "%sdom_set_attr_node.php"
["line":protected]=>
}
["previous":"Exception":private]=>
NULL
- ["code"]=>
- int(4)
}
reference, object, forward declaration...
int(1)
object(bar)#%d (2) {
- ["bar"]=>
- &string(1) "a"
["foo"]=>
&string(1) "a"
+ ["bar"]=>
+ &string(1) "a"
}
string(1) "a"
references, object, private...
int(1)
string(1) "a"
object(mega_bar)#5 (4) {
+ ["foo"]=>
+ &string(1) "a"
+ ["bar"]=>
+ &string(1) "a"
[%s]=>
&int(1)
["id_ref"]=>
&int(1)
- ["bar"]=>
- &string(1) "a"
- ["foo"]=>
- &string(1) "a"
}
done!
array(3) {
[0]=>
object(TestDerived)#%d (5) {
- ["row":protected]=>
- int(0)
["id"]=>
string(1) "1"
["val":protected]=>
string(1) "A"
["val2":"TestBase":private]=>
NULL
+ ["row":protected]=>
+ int(0)
["val2"]=>
string(2) "AA"
}
[1]=>
object(TestDerived)#%d (5) {
- ["row":protected]=>
- int(1)
["id"]=>
string(1) "2"
["val":protected]=>
string(1) "B"
["val2":"TestBase":private]=>
NULL
+ ["row":protected]=>
+ int(1)
["val2"]=>
string(2) "BB"
}
[2]=>
object(TestDerived)#%d (5) {
- ["row":protected]=>
- int(2)
["id"]=>
string(1) "3"
["val":protected]=>
string(1) "C"
["val2":"TestBase":private]=>
NULL
+ ["row":protected]=>
+ int(2)
["val2"]=>
string(2) "CC"
}
===INSERT===
TestBase::serialize() = 'a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}'
TestDerived::serialize()
-TestBase::serialize() = 'a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}'
+TestBase::serialize() = 'a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}'
TestDerived::serialize()
-TestBase::serialize() = 'a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}'
+TestBase::serialize() = 'a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}'
===DATA===
array(4) {
[0]=>
[1]=>
string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}"
[2]=>
- string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}"
+ string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
[3]=>
- string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}"
+ string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
}
===FAILURE===
Exception:SQLSTATE[HY000]: General error: cannot unserialize class
["name"]=>
string(11) "TestDerived"
["val"]=>
- string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}"
+ string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
}
[2]=>
array(2) {
["name"]=>
NULL
["val"]=>
- string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}"
+ string(172) "a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}"
}
}
===FETCHCLASS===
TestBase::unserialize(a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";})
TestDerived::unserialize()
-TestBase::unserialize(a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";})
+TestBase::unserialize(a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";})
TestDerived::unserialize()
-TestBase::unserialize(a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";s:7:"BasePri";s:7:"Private";})
+TestBase::unserialize(a:5:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:7:"BasePri";s:7:"Private";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";})
array(3) {
[0]=>
object(TestBase)#%d (3) {
string(14) "#DerivedPublic"
["BasePro":protected]=>
string(17) "#DerivdeProtected"
+ ["BasePri":"TestBase":private]=>
+ string(8) "#Private"
["DerivedPub"]=>
string(7) "#Public"
["DerivedPro":protected]=>
string(10) "#Protected"
["DerivedPri":"TestDerived":private]=>
string(7) "Private"
- ["BasePri":"TestBase":private]=>
- string(8) "#Private"
}
[2]=>
object(TestLeaf)#%d (6) {
string(14) "#DerivedPublic"
["BasePro":protected]=>
string(17) "#DerivdeProtected"
+ ["BasePri":"TestBase":private]=>
+ string(8) "#Private"
["DerivedPub"]=>
string(7) "#Public"
["DerivedPro":protected]=>
string(10) "#Protected"
["DerivedPri":"TestDerived":private]=>
string(7) "Private"
- ["BasePri":"TestBase":private]=>
- string(8) "#Private"
}
}
PDODatabaseX::query()
PDOStatementX::__construct()
object(PDOStatementX)#%d (3) {
- ["test1"]=>
- int(1)
["queryString"]=>
string(24) "SELECT val, id FROM test"
+ ["test1"]=>
+ int(1)
["test2"]=>
int(22)
}
--EXPECT--
B Object
(
- [y] => 6
[x] => 5
+ [y] => 6
)
array(2) {
[0]=>
object(Child_test1)#%d (4) {
- ["member2"]=>
- int(102)
["member1"]=>
int(100)
["var1"]=>
int(30)
["var2"]=>
int(101)
+ ["member2"]=>
+ int(102)
}
[1]=>
object(Child_test1)#%d (4) {
- ["member2"]=>
- int(102)
["member1"]=>
int(100)
["var1"]=>
int(30)
["var2"]=>
int(101)
+ ["member2"]=>
+ int(102)
}
}
-- Iteration 4 --
array(2) {
[0]=>
object(Child_test2)#%d (4) {
- ["member1":"Child_test2":private]=>
- int(102)
+ ["member1":"Test2":private]=>
+ int(100)
["var1"]=>
int(30)
["var2"]=>
int(101)
- ["member1":"Test2":private]=>
- int(100)
+ ["member1":"Child_test2":private]=>
+ int(102)
}
[1]=>
object(Child_test2)#%d (4) {
- ["member1":"Child_test2":private]=>
- int(102)
+ ["member1":"Test2":private]=>
+ int(100)
["var1"]=>
int(30)
["var2"]=>
int(101)
- ["member1":"Test2":private]=>
- int(100)
+ ["member1":"Child_test2":private]=>
+ int(102)
}
}
-- Iteration 6 --
array(2) {
[0]=>
object(Child_test4)#%d (4) {
- ["var1"]=>
- int(103)
["member1"]=>
int(100)
["member2":"Test4":private]=>
int(101)
["member3":protected]=>
int(102)
+ ["var1"]=>
+ int(103)
}
[1]=>
object(Child_test4)#%d (4) {
- ["var1"]=>
- int(103)
["member1"]=>
int(100)
["member2":"Test4":private]=>
int(101)
["member3":protected]=>
int(102)
+ ["var1"]=>
+ int(103)
}
}
-- Iteration 10 --
}
[2]=>
object(ChildClass)#%d (2) {
- ["var3":"ChildClass":private]=>
- NULL
["var2":protected]=>
int(5)
+ ["var3":"ChildClass":private]=>
+ NULL
}
[3]=>
object(FinalClass)#%d (1) {
}
[2]=>
object(ChildClass)#%d (2) {
- ["var3":"ChildClass":private]=>
- NULL
["var2":protected]=>
int(5)
+ ["var3":"ChildClass":private]=>
+ NULL
}
[3]=>
object(FinalClass)#%d (1) {
array(5) {
[0]=>
object(ChildClass)#%d (2) {
- ["var3":"ChildClass":private]=>
- NULL
["var2":protected]=>
int(5)
+ ["var3":"ChildClass":private]=>
+ NULL
}
["f"]=>
string(5) "first"
array(7) {
[0]=>
object(ChildClass)#%d (2) {
- ["var3":"ChildClass":private]=>
- NULL
["var2":protected]=>
int(5)
+ ["var3":"ChildClass":private]=>
+ NULL
}
[1]=>
string(5) "hello"
array(4) {
[2]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(15)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(15)
}
[0]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(20)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(20)
}
[1]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(500)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(500)
}
[3]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(700)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(700)
}
}
Done
array(4) {
[0]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(15)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(15)
}
[1]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(20)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(20)
}
[2]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(500)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(500)
}
[3]=>
object(ChildClass)#%d (2) {
- ["child_value"]=>
- int(700)
["pub_value"]=>
NULL
+ ["child_value"]=>
+ int(700)
}
}
---( Superclass: )---
A::test
array(3) {
+ ["hiddenPriv"]=>
+ string(13) "A::hiddenPriv"
["prot"]=>
string(7) "B::prot"
["pub"]=>
string(6) "B::pub"
- ["hiddenPriv"]=>
- string(13) "A::hiddenPriv"
}
---( Unrelated class: )---
---( Superclass: )---
A::testA
array(3) {
+ ["hiddenPriv"]=>
+ string(13) "A::hiddenPriv"
["prot"]=>
string(7) "B::prot"
["pub"]=>
string(6) "B::pub"
- ["hiddenPriv"]=>
- string(13) "A::hiddenPriv"
}
--EXPECT--
string(63) "O:1:"B":2:{i:0;a:1:{i:0;O:8:"stdClass":0:{}}i:1;a:1:{i:0;r:3;}}"
object(B)#3 (2) {
- ["data2":"B":private]=>
+ ["data":"A":private]=>
array(1) {
[0]=>
object(stdClass)#4 (0) {
}
}
- ["data":"A":private]=>
+ ["data2":"B":private]=>
array(1) {
[0]=>
object(stdClass)#4 (0) {
--EXPECT--
Derived Object
(
- [id:protected] => 44
[id:Base:private] => 64
+ [id:protected] => 44
)
Before serialization:
object(B)#%d (6) {
- ["BPriv":"B":private]=>
- string(7) "B.BPriv"
- ["BProt":protected]=>
- string(7) "B.BProt"
- ["BPub"]=>
- string(6) "B.BPub"
["APriv":"A":private]=>
string(7) "A.APriv"
["AProt":protected]=>
string(7) "A.AProt"
["APub"]=>
string(6) "A.APub"
-}
-Serialized form:
-string(184) "O:1:"B":6:{s:8:"\0B\0BPriv";s:7:"B.BPriv";s:8:"\0*\0BProt";s:7:"B.BProt";s:4:"BPub";s:6:"B.BPub";s:8:"\0A\0APriv";s:7:"A.APriv";s:8:"\0*\0AProt";s:7:"A.AProt";s:4:"APub";s:6:"A.APub";}"
-Unserialized:
-object(B)#%d (6) {
["BPriv":"B":private]=>
string(7) "B.BPriv"
["BProt":protected]=>
string(7) "B.BProt"
["BPub"]=>
string(6) "B.BPub"
+}
+Serialized form:
+string(184) "O:1:"B":6:{s:8:"\0A\0APriv";s:7:"A.APriv";s:8:"\0*\0AProt";s:7:"A.AProt";s:4:"APub";s:6:"A.APub";s:8:"\0B\0BPriv";s:7:"B.BPriv";s:8:"\0*\0BProt";s:7:"B.BProt";s:4:"BPub";s:6:"B.BPub";}"
+Unserialized:
+object(B)#%d (6) {
["APriv":"A":private]=>
string(7) "A.APriv"
["AProt":protected]=>
string(7) "A.AProt"
["APub"]=>
string(6) "A.APub"
+ ["BPriv":"B":private]=>
+ string(7) "B.BPriv"
+ ["BProt":protected]=>
+ string(7) "B.BProt"
+ ["BPub"]=>
+ string(6) "B.BPub"
}
Sanity check: bool(true)
Before serialization:
object(C)#%d (10) {
- ["APriv":"C":private]=>
- string(7) "C.APriv"
+ ["APriv":"A":private]=>
+ string(7) "A.APriv"
["AProt":protected]=>
string(7) "C.AProt"
["APub"]=>
string(6) "C.APub"
- ["CPriv":"C":private]=>
- string(7) "C.CPriv"
- ["CProt":protected]=>
- string(7) "C.BProt"
- ["CPub"]=>
- string(6) "C.CPub"
["BPriv":"B":private]=>
string(7) "B.BPriv"
["BProt":protected]=>
string(7) "B.BProt"
["BPub"]=>
string(6) "B.BPub"
- ["APriv":"A":private]=>
- string(7) "A.APriv"
-}
-Serialized form:
-string(302) "O:1:"C":10:{s:8:"\0C\0APriv";s:7:"C.APriv";s:8:"\0*\0AProt";s:7:"C.AProt";s:4:"APub";s:6:"C.APub";s:8:"\0C\0CPriv";s:7:"C.CPriv";s:8:"\0*\0CProt";s:7:"C.BProt";s:4:"CPub";s:6:"C.CPub";s:8:"\0B\0BPriv";s:7:"B.BPriv";s:8:"\0*\0BProt";s:7:"B.BProt";s:4:"BPub";s:6:"B.BPub";s:8:"\0A\0APriv";s:7:"A.APriv";}"
-Unserialized:
-object(C)#%d (10) {
["APriv":"C":private]=>
string(7) "C.APriv"
- ["AProt":protected]=>
- string(7) "C.AProt"
- ["APub"]=>
- string(6) "C.APub"
["CPriv":"C":private]=>
string(7) "C.CPriv"
["CProt":protected]=>
string(7) "C.BProt"
["CPub"]=>
string(6) "C.CPub"
+}
+Serialized form:
+string(302) "O:1:"C":10:{s:8:"\0A\0APriv";s:7:"A.APriv";s:8:"\0*\0AProt";s:7:"C.AProt";s:4:"APub";s:6:"C.APub";s:8:"\0B\0BPriv";s:7:"B.BPriv";s:8:"\0*\0BProt";s:7:"B.BProt";s:4:"BPub";s:6:"B.BPub";s:8:"\0C\0APriv";s:7:"C.APriv";s:8:"\0C\0CPriv";s:7:"C.CPriv";s:8:"\0*\0CProt";s:7:"C.BProt";s:4:"CPub";s:6:"C.CPub";}"
+Unserialized:
+object(C)#%d (10) {
+ ["APriv":"A":private]=>
+ string(7) "A.APriv"
+ ["AProt":protected]=>
+ string(7) "C.AProt"
+ ["APub"]=>
+ string(6) "C.APub"
["BPriv":"B":private]=>
string(7) "B.BPriv"
["BProt":protected]=>
string(7) "B.BProt"
["BPub"]=>
string(6) "B.BPub"
- ["APriv":"A":private]=>
- string(7) "A.APriv"
+ ["APriv":"C":private]=>
+ string(7) "C.APriv"
+ ["CPriv":"C":private]=>
+ string(7) "C.CPriv"
+ ["CProt":protected]=>
+ string(7) "C.BProt"
+ ["CPub"]=>
+ string(6) "C.CPub"
}
Sanity check: bool(true)
Done
int(1)
}
object(myZip)#1 (%d) {
- ["test":"myZip":private]=>
- int(0)
- ["testp"]=>
- string(6) "foobar"
- ["testarray":"myZip":private]=>
- array(1) {
- [0]=>
- int(1)
- }
["lastId"]=>
int(-1)
["status"]=>
string(0) ""
["comment"]=>
string(0) ""
+ ["test":"myZip":private]=>
+ int(0)
+ ["testp"]=>
+ string(6) "foobar"
+ ["testarray":"myZip":private]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
}
int(1)
}
object(myZip)#1 (%d) {
- ["test":"myZip":private]=>
- int(0)
- ["testp"]=>
- string(6) "foobar"
- ["testarray":"myZip":private]=>
- array(1) {
- [0]=>
- int(1)
- }
["lastId"]=>
int(-1)
["status"]=>
string(0) ""
["comment"]=>
string(0) ""
+ ["test":"myZip":private]=>
+ int(0)
+ ["testp"]=>
+ string(6) "foobar"
+ ["testarray":"myZip":private]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
}
test Object
(
[p1] => test:1
+ [p2] => base:2
[p3] => test:3
[p4] => A
[p5] => test:5
- [p2] => base:2
[p6:base:private] => base:6
)
Clown
test Object
(
[p1] => test:1
+ [p2] => base:2
[p3] => test:3
[p4] => A
[p5] => clone:5
- [p2] => base:2
[p6:base:private] => base:6
)
Done
--EXPECT--
Original
object(test)#1 (2) {
- ["b"]=>
- array(2) {
- [0]=>
- int(3)
- [1]=>
- int(4)
- }
["a"]=>
array(2) {
[0]=>
[1]=>
int(2)
}
-}
-Clone
-object(test)#2 (2) {
["b"]=>
array(2) {
[0]=>
[1]=>
int(4)
}
+}
+Clone
+object(test)#2 (2) {
["a"]=>
array(2) {
[0]=>
[1]=>
int(2)
}
+ ["b"]=>
+ array(2) {
+ [0]=>
+ int(3)
+ [1]=>
+ int(4)
+ }
}
Modify
object(test)#2 (2) {
- ["b"]=>
- int(6)
["a"]=>
int(5)
+ ["b"]=>
+ int(6)
}
Done
}
}
object(C)#%d (3) {
- ["a_c_parent"]=>
+ ["a_b"]=>
array(1) {
["key"]=>
string(5) "value"
}
- ["a_c_self"]=>
+ ["a_c_parent"]=>
array(1) {
["key"]=>
string(5) "value"
}
- ["a_b"]=>
+ ["a_c_self"]=>
array(1) {
["key"]=>
string(5) "value"
Testing class derived
derived Object
(
- [other] => other
[name] => init
+ [other] => other
)
base::__construct
derived Object
(
- [other] => other
[name] => base
+ [other] => other
)
derived::__construct
derived Object
(
- [other] => other
[name] => derived
+ [other] => other
)
base::__destruct
derived Object
(
- [other] => other
[name] => derived
+ [other] => other
)
derived::__destruct
derived Object
(
- [other] => other
[name] => derived
+ [other] => other
)
Done
?>
--EXPECTF--
object(C)#%d (2) {
- ["c":"B":private]=>
- NULL
["c":"A":private]=>
NULL
+ ["c":"B":private]=>
+ NULL
}
base::test
derived Object
(
- [member] => derived::member (default)
[member:base:private] => base::member
+ [member] => derived::member (default)
)
derived::test
derived Object
(
- [member] => derived::member (default)
[member:base:private] => base::member
+ [member] => derived::member (default)
)
base::__construct(end)
base::test
derived Object
(
- [member] => derived::member (default)
[member:base:private] => base::member
+ [member] => derived::member (default)
)
base::test
derived Object
(
- [member] => derived::member (default)
[member:base:private] => base::member
+ [member] => derived::member (default)
)
derived::test
derived Object
(
- [member] => derived::member (default)
[member:base:private] => base::member
+ [member] => derived::member (default)
)
derived::__construct(end)
base::test
derived Object
(
- [member] => derived::member
[member:base:private] => base::member
+ [member] => derived::member
)
derived::test
derived Object
(
- [member] => derived::member
[member:base:private] => base::member
+ [member] => derived::member
)
Done
--> Using instance of D:
in D::doForEachOnThis
-string(10) "Original f"
-string(10) "Original g"
string(10) "Original a"
string(10) "Original b"
string(10) "Original c"
string(10) "Original d"
+string(10) "Original f"
+string(10) "Original g"
object(D)#%d (7) {
- ["f":"D":private]=>
- string(9) "changed.f"
- ["g":protected]=>
- string(9) "changed.g"
["a"]=>
string(9) "changed.a"
["b"]=>
string(9) "changed.d"
["e":"C":private]=>
string(10) "Original e"
+ ["f":"D":private]=>
+ string(9) "changed.f"
+ ["g":protected]=>
+ string(9) "changed.g"
}
--> Using instance of E:
string(12) "Overridden b"
string(12) "Overridden c"
string(12) "Overridden d"
-string(12) "Overridden e"
string(10) "Original g"
+string(12) "Overridden e"
object(E)#%d (8) {
["a"]=>
string(9) "changed.a"
string(9) "changed.c"
["d":protected]=>
string(9) "changed.d"
- ["e":"E":private]=>
- string(9) "changed.e"
+ ["e":"C":private]=>
+ string(10) "Original e"
["f":"D":private]=>
string(10) "Original f"
["g":protected]=>
string(9) "changed.g"
- ["e":"C":private]=>
- string(10) "Original e"
+ ["e":"E":private]=>
+ string(9) "changed.e"
}
--> Using instance of D:
in C::doForEachC
-string(10) "Original g"
string(10) "Original a"
string(10) "Original b"
string(10) "Original c"
string(10) "Original d"
string(10) "Original e"
+string(10) "Original g"
object(D)#%d (7) {
- ["f":"D":private]=>
- string(10) "Original f"
- ["g":protected]=>
- string(9) "changed.g"
["a"]=>
string(9) "changed.a"
["b"]=>
string(9) "changed.d"
["e":"C":private]=>
string(9) "changed.e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
}
--> Using instance of E:
string(12) "Overridden b"
string(12) "Overridden c"
string(12) "Overridden d"
-string(10) "Original g"
string(10) "Original e"
+string(10) "Original g"
object(E)#%d (8) {
["a"]=>
string(9) "changed.a"
string(9) "changed.c"
["d":protected]=>
string(9) "changed.d"
- ["e":"E":private]=>
- string(12) "Overridden e"
+ ["e":"C":private]=>
+ string(9) "changed.e"
["f":"D":private]=>
string(10) "Original f"
["g":protected]=>
string(9) "changed.g"
- ["e":"C":private]=>
- string(9) "changed.e"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
}
--> Using instance of D:
in C::doForEach
-string(10) "Original g"
string(10) "Original a"
string(10) "Original b"
string(10) "Original c"
string(10) "Original d"
string(10) "Original e"
+string(10) "Original g"
object(D)#%d (7) {
- ["f":"D":private]=>
- string(10) "Original f"
- ["g":protected]=>
- string(9) "changed.g"
["a"]=>
string(9) "changed.a"
["b"]=>
string(9) "changed.d"
["e":"C":private]=>
string(9) "changed.e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
}
in D::doForEach
-string(10) "Original f"
-string(10) "Original g"
string(10) "Original a"
string(10) "Original b"
string(10) "Original c"
string(10) "Original d"
+string(10) "Original f"
+string(10) "Original g"
object(D)#%d (7) {
- ["f":"D":private]=>
- string(9) "changed.f"
- ["g":protected]=>
- string(9) "changed.g"
["a"]=>
string(9) "changed.a"
["b"]=>
string(9) "changed.d"
["e":"C":private]=>
string(10) "Original e"
+ ["f":"D":private]=>
+ string(9) "changed.f"
+ ["g":protected]=>
+ string(9) "changed.g"
}
in E::doForEach
-string(10) "Original g"
string(10) "Original a"
string(10) "Original b"
string(10) "Original c"
string(10) "Original d"
+string(10) "Original g"
object(D)#%d (7) {
- ["f":"D":private]=>
- string(10) "Original f"
- ["g":protected]=>
- string(9) "changed.g"
["a"]=>
string(9) "changed.a"
["b"]=>
string(9) "changed.d"
["e":"C":private]=>
string(10) "Original e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
}
--> Using instance of E:
string(12) "Overridden b"
string(12) "Overridden c"
string(12) "Overridden d"
-string(10) "Original g"
string(10) "Original e"
+string(10) "Original g"
object(E)#%d (8) {
["a"]=>
string(9) "changed.a"
string(9) "changed.c"
["d":protected]=>
string(9) "changed.d"
- ["e":"E":private]=>
- string(12) "Overridden e"
+ ["e":"C":private]=>
+ string(9) "changed.e"
["f":"D":private]=>
string(10) "Original f"
["g":protected]=>
string(9) "changed.g"
- ["e":"C":private]=>
- string(9) "changed.e"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
}
in D::doForEach
string(12) "Overridden a"
string(9) "changed.c"
["d":protected]=>
string(9) "changed.d"
- ["e":"E":private]=>
- string(12) "Overridden e"
+ ["e":"C":private]=>
+ string(10) "Original e"
["f":"D":private]=>
string(9) "changed.f"
["g":protected]=>
string(9) "changed.g"
- ["e":"C":private]=>
- string(10) "Original e"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
}
in E::doForEach
string(12) "Overridden a"
string(12) "Overridden b"
string(12) "Overridden c"
string(12) "Overridden d"
-string(12) "Overridden e"
string(10) "Original g"
+string(12) "Overridden e"
object(E)#%d (8) {
["a"]=>
string(9) "changed.a"
string(9) "changed.c"
["d":protected]=>
string(9) "changed.d"
- ["e":"E":private]=>
- string(9) "changed.e"
+ ["e":"C":private]=>
+ string(10) "Original e"
["f":"D":private]=>
string(10) "Original f"
["g":protected]=>
string(9) "changed.g"
- ["e":"C":private]=>
- string(10) "Original e"
+ ["e":"E":private]=>
+ string(9) "changed.e"
}
string(10) "Original b"
string(10) "Original c"
object(D)#%d (7) {
- ["f":"D":private]=>
- string(10) "Original f"
- ["g":protected]=>
- string(10) "Original g"
["a"]=>
string(9) "changed.a"
["b"]=>
string(10) "Original d"
["e":"C":private]=>
string(10) "Original e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(10) "Original g"
}
--> Using instance of E:
&string(9) "changed.c"
["d":protected]=>
string(12) "Overridden d"
- ["e":"E":private]=>
- string(12) "Overridden e"
+ ["e":"C":private]=>
+ string(10) "Original e"
["f":"D":private]=>
string(10) "Original f"
["g":protected]=>
string(10) "Original g"
- ["e":"C":private]=>
- string(10) "Original e"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
}