Category
php-in-php · stdlib
Problem
print_r() VM logic lives in PHP (ext/standard/print_r.php, VmVar) but JIT/AOT still lower to __compiler_print_r with a parallel LLVM implementation in lib/JIT/Builtin/StringPrintRJit.php (formerly phpc_print_r.c).
Property-hook hiding (#8854), enum cases, and recursion guards must not be implemented twice (VM PHP vs LLVM).
php-src reference
Repro
<?php
class C { public int $x = 1; }
ob_start();
print_r(new C());
$s = ob_get_clean();
echo $s;
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php repro_print_r.php
php bin/jit.php repro_print_r.php'
Scope (this repo)
| Layer |
Path |
| VM |
ext/standard/print_r.php, ext/standard/VmVar.php |
| JIT today |
lib/JIT/Builtin/StringPrintRJit.php |
| Target |
JIT invokes PHP VmVar::printR (or compiled native shim); shrink LLVM |
Pairs #9188 (var_export) and #8854 (property hooks in dumps).
Done when
Related
Category
php-in-php·stdlibProblem
print_r()VM logic lives in PHP (ext/standard/print_r.php,VmVar) but JIT/AOT still lower to__compiler_print_rwith a parallel LLVM implementation inlib/JIT/Builtin/StringPrintRJit.php(formerlyphpc_print_r.c).Property-hook hiding (#8854), enum cases, and recursion guards must not be implemented twice (VM PHP vs LLVM).
php-src reference
ext/standard/var.c—php_print_r,php_print_r_implRepro
Scope (this repo)
ext/standard/print_r.php,ext/standard/VmVar.phplib/JIT/Builtin/StringPrintRJit.phpVmVar::printR(or compiled native shim); shrink LLVMPairs #9188 (var_export) and #8854 (property hooks in dumps).
Done when
print_r()output matches VM/Zend on reproStringPrintRJit.phpLLVM dumper removed or thin ABI onlytest/compliance/cases/stdlib/print_r*.phptvar.cref + LLVM lines removed countRelated