Skip to content

php-in-php: unserialize() parser — delete phpc_unserialize.c, VmUnserialize PHP path for VM+JIT+AOT #5991

Description

@PurHur

Category

php-in-php | bootstrap

Problem

unserialize() JIT/AOT links lib/AOT/runtime/phpc_unserialize.c via lib/JIT/Builtin/StringUnserialize.php. VM uses PHP helpers but the AOT floor still carries a hand-written C parser. Enum singleton restore parity is #5739; this issue is the C→PHP migration of the parser itself.

php-src reference

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
wc -l lib/AOT/runtime/phpc_unserialize.c
grep phpc_unserialize lib/AOT/Linker.php lib/JIT/Builtin/StringUnserialize.php
php bin/vm.php -r "var_dump(unserialize(\"a:2:{i:0;i:1;i:1;s:3:\\\"foo\\\";}\"));"'

Scope

Path Work
ext/standard/VmSerialize.php / VmUnserialize.php Expand PHP parser to cover JIT/AOT subset today in C
lib/JIT/Builtin/StringUnserialize.php Lower via PHP implementation, not C bitcode
lib/AOT/Linker.php Drop phpc_unserialize.c
Delete lib/AOT/runtime/phpc_unserialize.c

Done when

Related

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:compilerCompiler / CFG / JITarea:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions