Category
stdlib
Problem
get_debug_type() handles scalars and objects but not enum case values (Variable::TYPE_ENUM_CASE). Passing a backed or unit enum case throws LogicException: get_debug_type() does not support this value type in this compiler build.
Zend returns the enum class name (same string as get_class($case) on enum cases in PHP 8.1+).
php-src reference
Repro (failure today)
<?php
declare(strict_types=1);
// test/repro-maintainer/get_debug_type_enum.php
enum Color: string { case Red = 'r'; }
enum Size { case S; }
echo get_debug_type(Color::Red), "\n";
echo get_debug_type(Size::S), "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro-maintainer/get_debug_type_enum.php
php bin/vm.php test/repro-maintainer/get_debug_type_enum.php
'
| Call |
Zend PHP 8.x |
This compiler VM (today) |
get_debug_type(Color::Red) |
Color |
LogicException |
get_debug_type(Size::S) |
Size |
LogicException |
Scope (this repo)
| Module |
Path |
| VM |
ext/standard/get_debug_type.php — branch on Variable::TYPE_ENUM_CASE |
| JIT |
get_debug_type.php call() + boxed TYPE_VALUE path |
| Tests |
test/compliance/cases/stdlib/get_debug_type_enum.phpt |
Out of scope here: resource type label (separate issue if streams expose resources without get_resource_type parity).
Done when
Related
Category
stdlibProblem
get_debug_type()handles scalars and objects but not enum case values (Variable::TYPE_ENUM_CASE). Passing a backed or unit enum case throwsLogicException: get_debug_type() does not support this value type in this compiler build.Zend returns the enum class name (same string as
get_class($case)on enum cases in PHP 8.1+).php-src reference
ext/standard/type.c—PHP_FUNCTION(get_debug_type),zend_value_to_type()forIS_OBJECTenum instancesZend/zend_enum.c— enum object handlersRepro (failure today)
get_debug_type(Color::Red)ColorLogicExceptionget_debug_type(Size::S)SizeLogicExceptionScope (this repo)
ext/standard/get_debug_type.php— branch onVariable::TYPE_ENUM_CASEget_debug_type.phpcall()+ boxedTYPE_VALUEpathtest/compliance/cases/stdlib/get_debug_type_enum.phptOut of scope here:
resourcetype label (separate issue if streams expose resources withoutget_resource_typeparity).Done when
ColorandSizeon VM matching Zend./script/ci-fast.sh --filter get_debug_type_enumgreenRelated