Title: zend_mm_heap corrupted when serializing/unserializing Enum · Issue #181 · msgpack/msgpack-php · GitHub
Open Graph Title: zend_mm_heap corrupted when serializing/unserializing Enum · Issue #181 · msgpack/msgpack-php
X Title: zend_mm_heap corrupted when serializing/unserializing Enum · Issue #181 · msgpack/msgpack-php
Description: This one works fine: enum Random: int { case One = 1; case Two = 2; case Three = 3; case Four = 4; case Five = 5; } $value = (object)[ 'one' => Random::One ]; $serialized = msgpack_serialize($value); $unserialized = msgpack_unserialize($...
Open Graph Description: This one works fine: enum Random: int { case One = 1; case Two = 2; case Three = 3; case Four = 4; case Five = 5; } $value = (object)[ 'one' => Random::One ]; $serialized = msgpack_serialize($value...
X Description: This one works fine: enum Random: int { case One = 1; case Two = 2; case Three = 3; case Four = 4; case Five = 5; } $value = (object)[ 'one' => Random::One ]; $serialized = msgpack_seria...
Opengraph URL: https://github.com/msgpack/msgpack-php/issues/181
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"zend_mm_heap corrupted when serializing/unserializing Enum","articleBody":"This one works fine:\n\n```php\nenum Random: int\n{\n case One = 1;\n case Two = 2;\n case Three = 3;\n case Four = 4;\n case Five = 5;\n}\n\n$value = (object)[\n 'one' =\u003e Random::One\n];\n\n$serialized = msgpack_serialize($value);\n$unserialized = msgpack_unserialize($serialized);\n```\n\nThis one seems to fail with `zend_mm_heap corrupted` after running\n\n```php\nenum Random: int\n{\n case One = 1;\n case Two = 2;\n case Three = 3;\n case Four = 4;\n case Five = 5;\n}\n\n$value = (object)[\n 'one' =\u003e Random::One\n];\n\n$serialized = msgpack_serialize($value);\n$unserialized = msgpack_unserialize($serialized);\n\n$serialized2 = msgpack_serialize($value);\n$unserialized = msgpack_unserialize($serialized);\n```\n\nUsing the object methods also fails:\n\n```php\n$value = (object)[\n 'one' =\u003e Random::One\n];\n\n$packer = new \\MessagePack(true);\n$unpacker = new \\MessagePackUnpacker(true);\n\n$serialized = $packer-\u003epack($value);\n$unpacker-\u003efeed($serialized);\n$unpacker-\u003eexecute();\n$unserialized = $unpacker-\u003edata();\n\n$unpacker-\u003ereset();\n\n$serialized2 = $packer-\u003epack($value);\n$unpacker-\u003efeed($serialized);\n$unpacker-\u003eexecute();\n$unserialized2 = $unpacker-\u003edata();\n\n$unpacker-\u003ereset();\n```\n\nErrors in both\n\n```\nPHP 8.4.14 (cli) (built: Oct 24 2025 19:07:34) (NTS)\nCopyright (c) The PHP Group\nBuilt by https://github.com/docker-library/php\nZend Engine v4.4.14, Copyright (c) Zend Technologies\n with Zend OPcache v8.4.14, Copyright (c), by Zend Technologies\n with Xdebug v3.4.7, Copyright (c) 2002-2025, by Derick Rethans\n```\n\nand\n\n```\nPHP 8.4.16 (cli) (built: Dec 16 2025 16:03:34) (NTS)\nCopyright (c) The PHP Group\nBuilt by Homebrew\nZend Engine v4.4.16, Copyright (c) Zend Technologies\n with Xdebug v3.5.0, Copyright (c) 2002-2025, by Derick Rethans\n with Zend OPcache v8.4.16, Copyright (c), by Zend Technologies\n```","author":{"url":"https://github.com/earthiverse","@type":"Person","name":"earthiverse"},"datePublished":"2026-01-08T03:36:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/181/msgpack-php/issues/181"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b97411ea-542c-0111-e03e-9c3dc1a81eee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88F2:10B6B6:9C0A551:CE8A06B:696E0769 |
| html-safe-nonce | 2c208542dff5fd0ace561e64abd21f8aa5949ef48a1981fcd3ace3757c1816f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEYyOjEwQjZCNjo5QzBBNTUxOkNFOEEwNkI6Njk2RTA3NjkiLCJ2aXNpdG9yX2lkIjoiNzkwMjIyNjE2MTIwNTExODgyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f50dc579223c3613fb518523ccf7807d7ae71606cd19395c17a1cc05c596ab99 |
| hovercard-subject-tag | issue:3791094125 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/msgpack/msgpack-php/181/issue_layout |
| twitter:image | https://opengraph.githubassets.com/775117e84c0bfe640df0e3ffa07e70b78b5f0d953cd3cd14434855f0f5ef9a8c/msgpack/msgpack-php/issues/181 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/775117e84c0bfe640df0e3ffa07e70b78b5f0d953cd3cd14434855f0f5ef9a8c/msgpack/msgpack-php/issues/181 |
| og:image:alt | This one works fine: enum Random: int { case One = 1; case Two = 2; case Three = 3; case Four = 4; case Five = 5; } $value = (object)[ 'one' => Random::One ]; $serialized = msgpack_serialize($value... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | earthiverse |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b5131b207ddd175abf059a848d5f4302ec0606b02211b989013be49cf08593e |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-php git https://github.com/msgpack/msgpack-php.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 5481147 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-php |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5481147 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-php |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8590a63bfc8093b241930ca57d536c9a50f9680 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width