You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#4446 tracks backed enum json_encode → backing scalar. Unit enums (no backing type) are a separate Zend path: json_encode(E::A) must throw ValueError: json_encode(): Argument #1 (\$value) contains an invalid JSON type (PHP 8.3+).
This compiler returns a build-specific LogicException (json_encode() value type not supported in this compiler build) — wrong class/message and blocks parity tests.
Category
stdlibProblem
#4446 tracks backed enum
json_encode→ backing scalar. Unit enums (no backing type) are a separate Zend path:json_encode(E::A)must throwValueError: json_encode(): Argument #1 (\$value) contains an invalid JSON type(PHP 8.3+).This compiler returns a build-specific
LogicException(json_encode() value type not supported in this compiler build) — wrong class/message and blocks parity tests.php-src reference
ext/json/php_json.c—php_json_encode()enum branchZend/zend_enum.c— unit vs backed caseRepro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php' php repro.phpValueError: json_encode(): Argument #1 ($value) contains an invalid JSON typeLogicException: json_encode() value type not supported…Scope (this repo)
ext/standard/VmJson.php(or json module), enum case type dispatchjson_encode)test/compliance/cases/stdlib/json_encode_unit_enum.phptDone when
ValueErrorwith Zend message subset"a"JSON string)./script/ci-fast.sh --filter json_encode_unit_enumgreenRelated