Skip to content

Stdlib: thin AOT session wire load/save only handles first string pair — multi-key + int/bool/null (ext/session) #21922

Description

@PurHur

Category

stdlib · php-src-strict · follow-up to #21900

Problem

#21900 LLVM session I/O (JitSessionStorageKernel::emitSessionWireSaveToPath / emitSessionWireLoadFromPath) is enough for 005-SessionsWeb (flash|s:N:"…";) but:

  1. Load parses only the first key|s:N:"val"; pair (no loop for concatenated pairs)
  2. Save only emits TYPE_STRING values from strKeys (skips int/bool/null/array)
  3. No numeric-key / i: / b: / N; wire coverage
Surface #21900 Target
$_SESSION['a']='x'; $_SESSION['b']='y' round-trip partial (first key only on load) full php session wire
$_SESSION['n']=1 not saved `n

php-src reference

PHP implementation target

  • ext/standard/JitSessionStorageKernel.php — loop wire load; emit int/bool/null (and ideally arrays via NestedJIT once #NEXT strlen fix lands)
  • Or restore NestedJIT VmSessionSerializer after NestedJIT string-length fix

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
cat > /tmp/multi.php << "PHP"
<?php
session_start();
$_SESSION["a"] = "one";
$_SESSION["b"] = "two";
$_SESSION["n"] = 3;
session_write_close();
PHP
php bin/compile.php -o /tmp/multi.bin /tmp/multi.php
SESSION_DIR=$(mktemp -d)
GATEWAY_INTERFACE=CGI/1.1 REQUEST_METHOD=GET PHP_COMPILER_SESSION_DIR="$SESSION_DIR" /tmp/multi.bin
cat "$SESSION_DIR"/sess_*
'

Done when

  • Multi string keys round-trip under thin AOT
  • int/bool/null session values persist (php-src wire)
  • SessionsWebAotExecuteTest still green; add unit/compliance for multi-key
  • php-src-strict

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 appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions