Skip to content

Regression: AOT Closure::call prints empty — VM/JIT match Zend (Zend/zend_closures.c) #26872

Description

@PurHur

Category

language · php-src-strict · AOT silent wrong output

Problem

Closure::call() with a bound $this returns the private property on Zend/VM/JIT, but the AOT binary builds successfully and prints nothing (characteristic silent wrong-output / empty-echo defect).

Repro Zend 8.2+ VM/JIT (2026-08-02) AOT (2026-08-02)
$f->call(new A()) with private $x=5 5 5 empty (exit 0)

php-src reference

PHP implementation target

  • lib/JIT/ Closure call / bound-object lowering + lib/ runtime helpers as needed — reuse VM semantics for call; no new C runtime branches

Repro

./script/docker-exec.sh -- bash -lc '
php test/repro/maintainer_gap_aot_closure_call.php
php bin/vm.php test/repro/maintainer_gap_aot_closure_call.php
php bin/jit.php test/repro/maintainer_gap_aot_closure_call.php
php bin/compile.php -o /tmp/ccall test/repro/maintainer_gap_aot_closure_call.php && /tmp/ccall
'
<?php
class A { private $x = 5; }
$f = function () { return $this->x; };
echo $f->call(new A()), "\n";

Done when

  • AOT binary prints 5 matching Zend/VM/JIT
  • Prefer --repeat / multi-run if heap corruption suspected
  • Repro or compliance guard
  • php-src-strict; no php-compiler-strict shortcut

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 / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions