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

Support php 7.4 __serialize/__unserialize and add new data type #237

Closed
TysonAndre opened this issue Mar 13, 2019 · 3 comments
Closed

Support php 7.4 __serialize/__unserialize and add new data type #237

TysonAndre opened this issue Mar 13, 2019 · 3 comments

Comments

@TysonAndre
Copy link
Member

https://wiki.php.net/rfc/custom_object_serialization

@TysonAndre TysonAndre changed the title Support php 7.4 __serialize/__unserialize when it is merged Support php 7.4 __serialize/__unserialize and add new data type May 23, 2019
@nicolas-grekas
Copy link

I just hit this issue today, this means the extension doesn't work with 7.4, e.g.:

php > var_dump(igbinary_unserialize(igbinary_serialize(new DateTime)));

PHP Warning:  Uncaught Error: Invalid serialization data for DateTime object in php shell code:1
Stack trace:
#0 [internal function]: DateTime->__wakeup()
#1 php shell code(1): igbinary_unserialize('\x00\x00\x00\x02\x17\x08DateTime\x14...')
#2 {main}
  thrown in php shell code on line 1

nicolas-grekas added a commit to symfony/symfony that referenced this issue Sep 20, 2019
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] skip igbinary on PHP 7.4.0

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Our CI currently fails because of that. I'm blacklisting 7.4.0 exactly so that we don't have to maintain these lines, betting on the issue being resolved before 7.4.1 is released.

See igbinary/igbinary#237

Commits
-------

2c0c131 [Cache] skip igbinary on PHP 7.4.0
@vladrusu
Copy link

vladrusu commented Dec 2, 2019

Maybe it's just me, but I don't receive any error with var_dump(igbinary_unserialize(igbinary_serialize(new DateTime)));

The DateTime object is returned correctly.

Using PHP 7.4 final and igbinary 3.0.1.

TysonAndre added a commit to TysonAndre/igbinary that referenced this issue Dec 2, 2019
TODO: Add tests of the many edge cases involved.

For igbinary#244 and igbinary#237
TysonAndre added a commit to TysonAndre/igbinary that referenced this issue Dec 3, 2019
TODO: Add tests of the many edge cases involved.

For igbinary#244 and igbinary#237

Try out newer build image to fix valgrind issue
TysonAndre added a commit to TysonAndre/igbinary that referenced this issue Dec 8, 2019
For igbinary#244 and igbinary#237

Switch to a newer build image and gcc version to fix a valgrind false positive.

Update appveyor config
TysonAndre added a commit to TysonAndre/igbinary that referenced this issue Dec 8, 2019
For igbinary#244 and igbinary#237

Switch to a newer build image and gcc version to fix a valgrind false positive.

Update appveyor config
TysonAndre added a commit to TysonAndre/igbinary that referenced this issue Dec 8, 2019
For igbinary#244 and igbinary#237

Switch to a newer build image and gcc version to fix a valgrind false positive.

Update appveyor config
TysonAndre added a commit to TysonAndre/igbinary that referenced this issue Dec 8, 2019
For igbinary#244 and igbinary#237

Switch to a newer build image and gcc version to fix a valgrind false positive.

Update appveyor config
@TysonAndre
Copy link
Member Author

Like php's serialize(), this is just using the same serialization format as if __serialize wasn't used, and the object had those properties. There are no new data types.

To make switching from/to igbinary to/from serialize()/unserialize() easier, this __serialize()/__unserialize() functionality is only provided in 7.4+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants