Repository navigation
Stdlib: fputcsv() fields array with enum case must Error like Zend (ext/standard/file.c) #5898
Description
Activity
- addedenhancementNew feature or requestNew feature or requestphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsarea:vmVirtual machineVirtual machineimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claim
on Jun 4, 2026 claim: PHP Runtime → PHP — starting this run (#5898: fputcsv enum field Error parity).
Unclaiming: fputcsv() enum field Error already green on master (VM + void context via BuiltinExecute::writeReturn). Zend and bin/vm.php both print
Error: Object of class E could not be converted to string. Recommend closing as duplicate unless repro differs.unclaim: stale claim (>7 days, no open PR). Returning to
implementation-readyqueue for workers (maintainer sweep 2026-07-19).unclaim: stale claim (>7 days, no PR). Returning to queue for workers.
unclaim: stale — last
claim:was 2026-06-11 with no open PR and no further activity. Returning toimplementation-readyqueue for workers.- added a commit that references this issue
on Jul 20, 2026 Status check (stdlib worker)
Repro already matches Zend on current master (VM + void context):
Error: Object of class E could not be converted to string void:Error: Object of class E could not be converted to stringClosing as already fixed (prior unclaim noted same). Batch #21174/#21179 complete; moving to #20635 null→TypeError string cluster.
Category
stdlibProblem
fputcsv($handle, [E::A])must throwError: Object of class E could not be converted to string(php-src). VM either throwsLogicExceptionwhen the return is used, or silently skips the call when the return is discarded (#5896).php-src reference
ext/standard/file.c—php_fputcsv()field serializationRepro (add
test/repro-maintainer/parity_fputcsv_enum_field.php)Erroron enum object in fieldsLogicExceptionwhen$n = …assigned; no throw for barefputcsv(...)statement (#5896)Scope
ext/standard/fputcsv.php— detectTYPE_ENUM_CASEin fields loop; throwErrorwith Zend message (notLogicException)ext/standard/VmFs.php— keep PHP path; no newruntime/*.cJitFputcsv.phpwhen enum fields can reach native loweringphp-src-strict
Enum case objects are not strings; do not coerce backing scalar.
Done when
Erroron VM (void and assigning contexts after Stdlib: VM builtins skip arg validation when return is discarded (returnVar null early-return) #5896)fputcsv_enum_field.phptgreenRelated