mirror of
https://github.com/php/php-src.git
synced 2024-12-03 06:44:07 +08:00
- Fixed tests
This commit is contained in:
parent
a3c8772fd1
commit
8a5ee4b33a
@ -130,13 +130,11 @@ object(myclass)#4 (1) {
|
||||
}
|
||||
|
||||
Using PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE to fetch the object from DB and unserialize it...
|
||||
myclass::__set(myobj, 'C:7:"myclass":19:{Data from serialize}')
|
||||
myclass::unserialize('C:7:"myclass":19:{Data from serialize}')
|
||||
myclass::__construct(PDO shall not call __construct())
|
||||
object(myclass)#%d (2) {
|
||||
object(myclass)#%d (1) {
|
||||
["myprotected":protected]=>
|
||||
string(19) "a protected propery"
|
||||
["myobj"]=>
|
||||
string(38) "C:7:"myclass":19:{Data from serialize}"
|
||||
}
|
||||
|
||||
Using PDO::FETCH_CLASS to fetch the object from DB and unserialize it...
|
||||
@ -148,4 +146,4 @@ object(myclass)#%d (2) {
|
||||
["myobj"]=>
|
||||
string(38) "C:7:"myclass":19:{Data from serialize}"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
|
@ -89,10 +89,8 @@ object(myclass)#%d (0) {
|
||||
}
|
||||
|
||||
And now PDO using setFetchMode(PDO::FETCH:CLASS|PDO::FETCH_SERIALIZE) + fetch()...
|
||||
myclass::__set('myobj', 'Data fetched from DB to be given to unserialize()')
|
||||
myclass::unserialize('Data fetched from DB to be given to unserialize()')
|
||||
myclass::__construct('Called by PDO') - note that it must not be called when unserializing
|
||||
object(myclass)#%d (1) {
|
||||
["myobj"]=>
|
||||
string(49) "Data fetched from DB to be given to unserialize()"
|
||||
object(myclass)#%d (0) {
|
||||
}
|
||||
done!
|
||||
done!
|
||||
|
Loading…
Reference in New Issue
Block a user