Skip to content

Stdlib: ext/msgpack — msgpack_pack()/msgpack_unpack() API missing (ext/msgpack) #6551

Description

@PurHur

Category

stdlib

Problem

The msgpack extension procedural API is absent. msgpack_pack() / msgpack_unpack() (and related helpers) are undefined, blocking libraries that serialize PHP values to MessagePack (caching, RPC, queue payloads).

No open issue tracks ext/msgpack (distinct from serialize()/json_encode() parity work).

php-src reference

Repro (failure today)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(function_exists(\"msgpack_pack\")); echo \"\\n\";
var_export(function_exists(\"msgpack_unpack\")); echo \"\\n\";"'
# bool(false) bool(false)

Zend (with ext/msgpack):

./script/docker-exec.sh -- bash -lc 'php -r "var_export(function_exists(\"msgpack_pack\")); echo \"\\n\";"'
# bool(true) when extension installed

Scope

Module Path
Extension ext/msgpack/ module + msgpack_pack.php, msgpack_unpack.php
VM Pure PHP encoder/decoder first (subset: null/bool/int/float/string/array/map); optional native fast path later
Registry ext/msgpack/Module.php, capability matrix entry
Tests test/compliance/cases/stdlib/msgpack_roundtrip.phpt

PHP-in-PHP first: avoid a permanent C codec in runtime/*.c; thin ABI only if a native fast path is proven necessary.

Done when

  • function_exists('msgpack_pack') and msgpack_unpack() true when module enabled
  • Round-trip repro for scalar + associative/nested arrays matches Zend on same inputs
  • Invalid payload throws/returns false with msgpack_unserialize() error semantics per php-src
  • Compliance .phpt passes: ./script/ci-fast.sh --filter msgpack

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro-maintainer/parity_msgpack_roundtrip.php'
./script/ci-fast.sh --filter msgpack

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions