Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private property in base class #91

Closed
rlalak opened this issue Jun 29, 2016 · 0 comments
Closed

Private property in base class #91

rlalak opened this issue Jun 29, 2016 · 0 comments

Comments

@rlalak
Copy link

rlalak commented Jun 29, 2016

When I serialize object which extends some base class with private property after unserialize I have default value for this property and extra field (with the same name) in not base class.

Classes

class TestBase
{
  private $name = 'default';

  public function getName()
  {
    return $this->name;
  }

  public function setName($name)
  {
    $this->name = $name;
  }
}

class Test extends TestBase
{

}

Code

$test = new Test();

$test->setName('new-name');
var_dump($test, $test->getName());

$new_test = msgpack_unpack(msgpack_pack($test));
var_dump($new_test, $new_test->getName());

Output

object(Test)#579 (1) {
  ["name":"TestBase":private]=>
  string(8) "new-name"
}
string(8) "new-name"


object(Test)#588 (2) {
  ["name":"TestBase":private]=>
  string(7) "default"
  ["name"]=>
  string(8) "new-name"
}
string(7) "default"

As you see method getName() return incorrect value in new object.

@m6w6 m6w6 closed this as completed in 2ccb314 Dec 18, 2019
m6w6 added a commit to m6w6/msgpack-php that referenced this issue Dec 20, 2019
+ Improved performance
+ Upgraded bundled msgpack headers to 3.2.0
* Merged PR msgpack#101: Update README in order to match compatibile PHP version
* Merged PR msgpack#125: fix ce->name is a zend_string
* Merged PR msgpack#106: Update README
* Merged PR msgpack#126: add mising tests in archive
* Merged PR msgpack#135: Add fixes for issue msgpack#81 This also includes tests.
* Merged PR msgpack#143: Fixed build with PHP-7.4
* Fixed issue msgpack#139: Segmentation fault when using cloned unpacker
* Fixed issue msgpack#132: Segfault on session php7.3
* Fixed issue msgpack#107: $unpacker->execute() bug
* Fixed issue msgpack#83: Arrays and negative index
* Fixed issue msgpack#137: DateTime(Immutable) serialization doesn't work with php 7.4 RC1
* Fixed issue msgpack#105: MessagePackUnpacker() bug
* Fixed issue msgpack#90: msgpack_unpack is super slow (30x times igbinary) on big data sets
* Fixed issue msgpack#91: Private property in base class
* Fixed issue msgpack#67: Integer overflow on a 64-bit system
* Fixed issue msgpack#33: int64 and uint64 decode is not supported in 32-bit php
* Fixed issue msgpack#119: uint64 numbers are cast to uint on Windows
* Fixed issue msgpack#134: msgpack-php msgpack_serialize/msgpack_pack not handling properly large int
* Fixed issue msgpack#81: Serialize optimization
* Fixed issue msgpack#108: tests/041.phpt failure
* Fixed issue msgpack#142: Recursion encoded as NULL
* Fixed issue msgpack#138: Serializers comparison for session like data
m6w6 added a commit to m6w6/msgpack-php that referenced this issue Feb 28, 2020
+ Improved performance
+ Upgraded bundled msgpack headers to 3.2.0
* Merged PR msgpack#101: Update README in order to match compatibile PHP version
* Merged PR msgpack#125: fix ce->name is a zend_string
* Merged PR msgpack#106: Update README
* Merged PR msgpack#126: add mising tests in archive
* Merged PR msgpack#135: Add fixes for issue msgpack#81 This also includes tests.
* Merged PR msgpack#143: Fixed build with PHP-7.4
* Fixed issue msgpack#139: Segmentation fault when using cloned unpacker
* Fixed issue msgpack#132: Segfault on session php7.3
* Fixed issue msgpack#107: $unpacker->execute() bug
* Fixed issue msgpack#83: Arrays and negative index
* Fixed issue msgpack#137: DateTime(Immutable) serialization doesn't work with php 7.4 RC1
* Fixed issue msgpack#105: MessagePackUnpacker() bug
* Fixed issue msgpack#90: msgpack_unpack is super slow (30x times igbinary) on big data sets
* Fixed issue msgpack#91: Private property in base class
* Fixed issue msgpack#67: Integer overflow on a 64-bit system
* Fixed issue msgpack#33: int64 and uint64 decode is not supported in 32-bit php
* Fixed issue msgpack#119: uint64 numbers are cast to uint on Windows
* Fixed issue msgpack#134: msgpack-php msgpack_serialize/msgpack_pack not handling properly large int
* Fixed issue msgpack#81: Serialize optimization
* Fixed issue msgpack#108: tests/041.phpt failure
* Fixed issue msgpack#142: Recursion encoded as NULL
* Fixed issue msgpack#138: Serializers comparison for session like data
m6w6 added a commit that referenced this issue Feb 28, 2020
+ Improved performance
+ Upgraded bundled msgpack headers to 3.2.0
* Merged PR #101: Update README in order to match compatibile PHP version
* Merged PR #125: fix ce->name is a zend_string
* Merged PR #106: Update README
* Merged PR #126: add mising tests in archive
* Merged PR #135: Add fixes for issue #81 This also includes tests.
* Merged PR #143: Fixed build with PHP-7.4
* Fixed issue #139: Segmentation fault when using cloned unpacker
* Fixed issue #132: Segfault on session php7.3
* Fixed issue #107: $unpacker->execute() bug
* Fixed issue #83: Arrays and negative index
* Fixed issue #137: DateTime(Immutable) serialization doesn't work with php 7.4 RC1
* Fixed issue #105: MessagePackUnpacker() bug
* Fixed issue #90: msgpack_unpack is super slow (30x times igbinary) on big data sets
* Fixed issue #91: Private property in base class
* Fixed issue #67: Integer overflow on a 64-bit system
* Fixed issue #33: int64 and uint64 decode is not supported in 32-bit php
* Fixed issue #119: uint64 numbers are cast to uint on Windows
* Fixed issue #134: msgpack-php msgpack_serialize/msgpack_pack not handling properly large int
* Fixed issue #81: Serialize optimization
* Fixed issue #108: tests/041.phpt failure
* Fixed issue #142: Recursion encoded as NULL
* Fixed issue #138: Serializers comparison for session like data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant