From 6954613d27a2e172988d3dff49c8509e8574d753 Mon Sep 17 00:00:00 2001 From: "ondrej@mirtes.cz" Date: Thu, 3 Dec 2026 13:22:57 +0000 Subject: [PATCH] Walk a foreach over a union of general arrays once per member What a loop body builds from the keys and the values of an iteratee like array|array comes from one member only, but the body was walked with the whole union, so `$copy[$key] = $value` gave array. With bleeding edge the declared union is no longer merged, so the copy was rejected as a return value (doctrine/dbal Connection::expandArrayParameters()). When the iteratee is a union of general arrays whose keys share no value, the loop is also walked once per member, with the iteratee narrowed to it and no node callback, and the scope after the loop is the join of those walks. Each walk converges with loop heads of its own. Amp-Thread-ID: https://ampcode.com/threads/T-01a23be5-5b73-7642-80c5-29429c352002 --- src/Analyser/StmtHandler/ForeachHandler.php | 93 +++++++++--- tests/PHPStan/Analyser/nsrt/bug-15946.php | 53 +++++++ .../Rules/Functions/ReturnTypeRuleTest.php | 7 + .../Rules/Functions/data/bug-15946.php | 42 ++++++ turbo-ext/src/ForeachHandler.cpp | 141 ++++++++++++++---- turbo-ext/src/generated/ForeachHandler.h | 52 ++++--- 6 files changed, 321 insertions(+), 67 deletions(-) create mode 100644 tests/PHPStan/Analyser/nsrt/bug-15946.php create mode 100644 tests/PHPStan/Rules/Functions/data/bug-15946.php diff --git a/src/Analyser/StmtHandler/ForeachHandler.php b/src/Analyser/StmtHandler/ForeachHandler.php index 54969157242..7d21de1621f 100644 --- a/src/Analyser/StmtHandler/ForeachHandler.php +++ b/src/Analyser/StmtHandler/ForeachHandler.php @@ -544,6 +544,7 @@ static function () use ($condResult, $emptyArrayType): Type { if ($context->isTopLevel() && $stmt->byRef) { $finalScope = $finalScope->assignExpression(new ForeachValueByRefExpr($stmt->valueVar), new MixedType(), new MixedType()); } + $finalScope = $this->processByIterateeMember($nodeScopeResolver, $stmt, $entryScope, $originalStorage, $context, $condResult->getType(), $condResult->getNativeType()) ?? $finalScope; $bindingFlow = VariableFlow::sequence( $stmt->keyVar !== null ? VariableFlowBuilder::targetRead($stmt->keyVar, $storage, false) : null, @@ -727,30 +728,17 @@ private function enterForeach(NodeScopeResolver $nodeScopeResolver, MutatingScop * a union like `array|array`. Ties the key, the value * and the iteratee together by the member: `is_int($key)` narrows `$value` * to `A` and the iteratee to `array`, and narrowing the iteratee to - * a member narrows the key and the value. Only when the members' keys share - * no value, so that the key tells the member. + * a member narrows the key and the value. */ private function addIterateeMemberConditionalHolders(MutatingScope $scope, Expr $iteratee, Type $iterateeType, string $keyVarName, string $valueVarName): MutatingScope { - if (!$iterateeType instanceof UnionType || $iterateeType instanceof BenevolentUnionType || $iterateeType instanceof TemplateType) { - return $scope; - } - $members = $iterateeType->getTypes(); - if (count($members) > self::ITERATEE_MEMBERS_LIMIT || !$scope->hasExpressionType($iteratee)->yes()) { + $members = self::getIterateeMembers($scope, $iteratee, $iterateeType); + if ($members === null) { return $scope; } $keyTypes = []; foreach ($members as $member) { - if (!$member->isArray()->yes() || $member->isConstantArray()->yes()) { - return $scope; - } - $keyType = $member->getIterableKeyType(); - foreach ($keyTypes as $otherKeyType) { - if (!$otherKeyType->isSuperTypeOf($keyType)->no()) { - return $scope; - } - } - $keyTypes[] = $keyType; + $keyTypes[] = $member->getIterableKeyType(); } $iterateeExprString = $scope->getNodeKey($iteratee); @@ -811,6 +799,77 @@ private static function writesOffsetWithLoopVariable(Foreach_ $stmt): bool }) !== null; } + /** + * The scope after the loop joined from walking it over each member of the + * iteratee: what the body builds from the keys and the values of one + * member, like `$copy[$key] = $value` over `array|array`, + * stays `array|array` instead of mixing the members. + */ + private function processByIterateeMember(NodeScopeResolver $nodeScopeResolver, Foreach_ $stmt, MutatingScope $entryScope, ExpressionResultStorage $storage, StatementContext $context, Type $iterateeType, Type $iterateeNativeType): ?MutatingScope + { + if ( + !$context->shouldConvergeLoops() + || $stmt->getDocComment() !== null + || !$stmt->valueVar instanceof Variable || !is_string($stmt->valueVar->name) + || !$stmt->keyVar instanceof Variable || !is_string($stmt->keyVar->name) + || $stmt->byRef + ) { + return null; + } + $members = self::getIterateeMembers($entryScope, $stmt->expr, $iterateeType); + if ($members === null) { + return null; + } + + $endScope = null; + foreach ($members as $member) { + // each walk converges with heads of its own, as its entry differs from the other walks' + $memberEndScope = $this->processStmt( + $nodeScopeResolver, + $stmt, + $entryScope->specifyExpressionType($stmt->expr, $member, $iterateeNativeType, TrinaryLogic::createYes()), + $storage->duplicate(), + new NoopNodeCallback(), + $context->enterLoopPass(new ConvergedLoopHeads()), + )->getScope(); + $endScope = $endScope === null ? $memberEndScope : $endScope->mergeWith($memberEndScope); + } + + return $endScope; + } + + /** + * The members of an iteratee union of general arrays whose keys share no + * value, so that the key tells the member. + * + * @return list|null + */ + private static function getIterateeMembers(MutatingScope $scope, Expr $iteratee, Type $iterateeType): ?array + { + if (!$iterateeType instanceof UnionType || $iterateeType instanceof BenevolentUnionType || $iterateeType instanceof TemplateType) { + return null; + } + $members = $iterateeType->getTypes(); + if (count($members) > self::ITERATEE_MEMBERS_LIMIT || !$scope->hasExpressionType($iteratee)->yes()) { + return null; + } + $keyTypes = []; + foreach ($members as $member) { + if (!$member->isArray()->yes() || $member->isConstantArray()->yes()) { + return null; + } + $keyType = $member->getIterableKeyType(); + foreach ($keyTypes as $otherKeyType) { + if (!$otherKeyType->isSuperTypeOf($keyType)->no()) { + return null; + } + } + $keyTypes[] = $keyType; + } + + return $members; + } + /** * @return array{bodyScope: MutatingScope, endScope: MutatingScope|null, totalKeys: int}|null */ diff --git a/tests/PHPStan/Analyser/nsrt/bug-15946.php b/tests/PHPStan/Analyser/nsrt/bug-15946.php new file mode 100644 index 00000000000..2c0c352d881 --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/bug-15946.php @@ -0,0 +1,53 @@ += 8.1 + +declare(strict_types = 1); + +namespace Bug15946Types; + +use function PHPStan\Testing\assertType; + +/** + * @param array|array $types + */ +function copyTypes(array $types): void +{ + $copy = []; + foreach ($types as $key => $type) { + $copy[$key] = $type; + } + + assertType('array|array', $copy); +} + +enum ParameterType { case STRING; } +enum ArrayParameterType { case STRING; } + +/** + * @param array, string|ParameterType|ArrayParameterType>|array $types + */ +function nonArrayTypes(array $types): void +{ + $nonArrayTypes = []; + foreach ($types as $key => $type) { + if ($type instanceof ArrayParameterType) { + return; + } + + $nonArrayTypes[$key] = $type; + } + + assertType('array, Bug15946Types\ParameterType|string>|array', $nonArrayTypes); +} + +/** + * @param array|array $types + */ +function swapKeysAndValues(array $types): void +{ + $flipped = []; + foreach ($types as $key => $type) { + $flipped[$type] = $key; + } + + assertType('array|array', $flipped); +} diff --git a/tests/PHPStan/Rules/Functions/ReturnTypeRuleTest.php b/tests/PHPStan/Rules/Functions/ReturnTypeRuleTest.php index 9f5d379f659..8c59e87e65e 100644 --- a/tests/PHPStan/Rules/Functions/ReturnTypeRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ReturnTypeRuleTest.php @@ -670,6 +670,13 @@ public function testBug15873(): void ]); } + public function testBug15946(): void + { + $this->checkExplicitMixed = false; + $this->checkNullables = true; + $this->analyse([__DIR__ . '/data/bug-15946.php'], []); + } + public function testFBound(): void { $this->checkNullables = true; diff --git a/tests/PHPStan/Rules/Functions/data/bug-15946.php b/tests/PHPStan/Rules/Functions/data/bug-15946.php new file mode 100644 index 00000000000..6db38842a73 --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/bug-15946.php @@ -0,0 +1,42 @@ += 8.1 + +declare(strict_types = 1); + +namespace Bug15946; + +/** + * @param array|array $types + * @return array|array + */ +function copyTypes(array $types): array +{ + $copy = []; + foreach ($types as $key => $type) { + $copy[$key] = $type; + } + + return $copy; +} + +enum ParameterType { case STRING; } +enum ArrayParameterType { case STRING; } + +/** + * Like Doctrine\DBAL\Connection::expandArrayParameters() + * + * @param array, string|ParameterType|ArrayParameterType>|array $types + * @return array, string|ParameterType>|array|null + */ +function nonArrayTypes(array $types): ?array +{ + $nonArrayTypes = []; + foreach ($types as $key => $type) { + if ($type instanceof ArrayParameterType) { + return null; + } + + $nonArrayTypes[$key] = $type; + } + + return $nonArrayTypes; +} diff --git a/turbo-ext/src/ForeachHandler.cpp b/turbo-ext/src/ForeachHandler.cpp index e67697221cf..45ba2e5ccce 100644 --- a/turbo-ext/src/ForeachHandler.cpp +++ b/turbo-ext/src/ForeachHandler.cpp @@ -917,6 +917,15 @@ class ForeachHandler if (UNEXPECTED(assigned.isUndef())) return zv::Val(); finalScope = std::move(assigned); } + { + zv::Val condIterateeType = pt_expression_result_get_type(condResult.raw()); + if (UNEXPECTED(condIterateeType.isUndef())) return zv::Val(); + zv::Val condIterateeNativeType = pt_expression_result_get_native_type(condResult.raw()); + if (UNEXPECTED(condIterateeNativeType.isUndef())) return zv::Val(); + zv::Val memberEndScope = processByIterateeMember(nodeScopeResolver, stmt, parts, entryScope, originalStorage, context, condIterateeType.raw(), condIterateeNativeType.raw()); + if (UNEXPECTED(memberEndScope.isUndef())) return zv::Val(); + if (!memberEndScope.isNull()) finalScope = std::move(memberEndScope); + } zv::Val bindingFlow; { @@ -1458,45 +1467,18 @@ class ForeachHandler } /* (twin addIterateeMemberConditionalHolders()) the key, the value and - * the iteratee tied together by the member of an iteratee union whose - * members' keys share no value; UNDEF = pending exception */ + * the iteratee tied together by the member of the iteratee union; + * UNDEF = pending exception */ static zv::Val addIterateeMemberConditionalHolders(zval *scopeArg, zval *iteratee, zval *iterateeType, zend_string *keyVarName, zend_string *valueVarName) { zv::Val scope = zv::Val::copyOf(zv::Ref(scopeArg)); - if (Z_TYPE_P(iterateeType) != IS_OBJECT || pt_ce_union_type == NULL || !instanceof_function(Z_OBJCE_P(iterateeType), pt_ce_union_type) - || (pt_ce_benevolent_union_type != NULL && instanceof_function(Z_OBJCE_P(iterateeType), pt_ce_benevolent_union_type))) { - return scope; - } - bool error = false; - if (ptsh::isInstanceOf(iterateeType, PT_CLASS_TEMPLATE_TYPE, error)) return scope; - if (UNEXPECTED(error)) return zv::Val(); - zv::Val members = pt_type_op(Z_OBJ_P(iterateeType), PT_OP_GET_TYPES, 0, NULL); - if (UNEXPECTED(members.isUndef())) return zv::Val(); - if (ptlh::countOf(members.raw()) > PT_FEH_ITERATEE_MEMBERS_LIMIT) return scope; - zend_long tracked = pt_mutating_scope_has_expression_type(Z_OBJ_P(scope.raw()), iteratee); - if (UNEXPECTED(tracked < 0)) return zv::Val(); - if (tracked != PT_TRI_YES) return scope; - + zv::Val members; + if (UNEXPECTED(!getIterateeMembers(scope.raw(), iteratee, iterateeType, members))) return zv::Val(); + if (members.isNull()) return scope; std::vector keyTypes; for (auto entry : zv::ArrRef(members.raw())) { - zval *member = entry.value().deref().raw(); - if (UNEXPECTED(Z_TYPE_P(member) != IS_OBJECT)) { - pt_throw_should_not_happen(); - return zv::Val(); - } - zend_long isArray = pt_type_op_trinary(Z_OBJ_P(member), PT_OP_IS_ARRAY, 0, NULL); - if (UNEXPECTED(isArray < 0)) return zv::Val(); - if (isArray != PT_TRI_YES) return scope; - zend_long isConstantArray = pt_type_op_trinary(Z_OBJ_P(member), PT_OP_IS_CONSTANT_ARRAY, 0, NULL); - if (UNEXPECTED(isConstantArray < 0)) return zv::Val(); - if (isConstantArray == PT_TRI_YES) return scope; - zv::Val keyType = typeOp(member, PT_OP_GET_ITERABLE_KEY_TYPE, "getIterableKeyType"); + zv::Val keyType = typeOp(entry.value().deref().raw(), PT_OP_GET_ITERABLE_KEY_TYPE, "getIterableKeyType"); if (UNEXPECTED(keyType.isUndef())) return zv::Val(); - for (zv::Val &otherKeyType : keyTypes) { - zend_long overlaps = isSuperTypeOf(otherKeyType.raw(), keyType.raw()); - if (UNEXPECTED(overlaps < 0)) return zv::Val(); - if (overlaps != PT_TRI_NO) return scope; - } keyTypes.push_back(std::move(keyType)); } @@ -1553,6 +1535,99 @@ class ForeachHandler return scope; } + /* (twin processByIterateeMember()) the scope after the loop joined from + * walking it over each member of the iteratee; null when the loop is not + * walked by member, UNDEF = pending exception */ + zv::Val processByIterateeMember(zval *nodeScopeResolver, zval *stmt, StmtParts &parts, zval *entryScope, zval *storage, zval *context, zval *iterateeType, zval *iterateeNativeType) const + { + bool shouldConvergeLoops; + if (UNEXPECTED(!pt_statement_context_should_converge_loops(context, shouldConvergeLoops))) return zv::Val(); + if (!shouldConvergeLoops) return zv::Val::null(); + bool noDocComment; + if (UNEXPECTED(!hasNoDocComment(stmt, noDocComment))) return zv::Val(); + if (!noDocComment || parts.valueVarName == NULL || parts.keyVarName == NULL || parts.byRef) return zv::Val::null(); + zval *iteratee = parts.expr.raw(); + zv::Val members; + if (UNEXPECTED(!getIterateeMembers(entryScope, iteratee, iterateeType, members))) return zv::Val(); + if (members.isNull()) return zv::Val::null(); + + zv::Val endScope = zv::Val::null(); + for (auto entry : zv::ArrRef(members.raw())) { + zval *member = entry.value().deref().raw(); + // each walk converges with heads of its own, as its entry differs from the other walks' + zv::Val memberScope = pt_mutating_scope_specify_expression_type(Z_OBJ_P(entryScope), Z_OBJ_P(iteratee), member, iterateeNativeType, pt_trinary_singleton(PT_TRI_YES)); + if (UNEXPECTED(memberScope.isUndef())) return zv::Val(); + zv::Val memberStorage = pt_expression_result_storage_duplicate(storage); + if (UNEXPECTED(memberStorage.isUndef())) return zv::Val(); + zv::Val noop = ptlh::newNoopNodeCallback(); + if (UNEXPECTED(noop.isUndef())) return zv::Val(); + zv::Val heads = pt_converged_loop_heads_new(); + if (UNEXPECTED(heads.isUndef())) return zv::Val(); + zv::Val memberContext = pt_statement_context_enter_loop_pass(context, heads.raw()); + if (UNEXPECTED(memberContext.isUndef())) return zv::Val(); + zv::Val memberResult = processStmt(nodeScopeResolver, stmt, memberScope.raw(), memberStorage.raw(), noop.raw(), memberContext.raw()); + if (UNEXPECTED(memberResult.isUndef())) return zv::Val(); + zv::Val hold; + zval *memberEndScope = pt_internal_statement_result_scope(memberResult.raw(), hold); + if (UNEXPECTED(memberEndScope == NULL)) return zv::Val(); + if (endScope.isNull()) { + endScope = zv::Val::copyOf(zv::Ref(memberEndScope)); + } else { + endScope = pt_mutating_scope_merge_with(Z_OBJ_P(endScope.raw()), memberEndScope); + if (UNEXPECTED(endScope.isUndef())) return zv::Val(); + } + } + + return endScope; + } + + /* (twin getIterateeMembers()) the members of an iteratee union of general + * arrays whose keys share no value, into `out` (null when it is not such + * a union); false = pending exception */ + [[nodiscard]] static bool getIterateeMembers(zval *scope, zval *iteratee, zval *iterateeType, zv::Val &out) + { + out = zv::Val::null(); + if (Z_TYPE_P(iterateeType) != IS_OBJECT || pt_ce_union_type == NULL || !instanceof_function(Z_OBJCE_P(iterateeType), pt_ce_union_type) + || (pt_ce_benevolent_union_type != NULL && instanceof_function(Z_OBJCE_P(iterateeType), pt_ce_benevolent_union_type))) { + return true; + } + bool error = false; + if (ptsh::isInstanceOf(iterateeType, PT_CLASS_TEMPLATE_TYPE, error)) return true; + if (UNEXPECTED(error)) return false; + zv::Val members = pt_type_op(Z_OBJ_P(iterateeType), PT_OP_GET_TYPES, 0, NULL); + if (UNEXPECTED(members.isUndef())) return false; + if (ptlh::countOf(members.raw()) > PT_FEH_ITERATEE_MEMBERS_LIMIT) return true; + zend_long tracked = pt_mutating_scope_has_expression_type(Z_OBJ_P(scope), iteratee); + if (UNEXPECTED(tracked < 0)) return false; + if (tracked != PT_TRI_YES) return true; + + std::vector keyTypes; + for (auto entry : zv::ArrRef(members.raw())) { + zval *member = entry.value().deref().raw(); + if (UNEXPECTED(Z_TYPE_P(member) != IS_OBJECT)) { + pt_throw_should_not_happen(); + return false; + } + zend_long isArray = pt_type_op_trinary(Z_OBJ_P(member), PT_OP_IS_ARRAY, 0, NULL); + if (UNEXPECTED(isArray < 0)) return false; + if (isArray != PT_TRI_YES) return true; + zend_long isConstantArray = pt_type_op_trinary(Z_OBJ_P(member), PT_OP_IS_CONSTANT_ARRAY, 0, NULL); + if (UNEXPECTED(isConstantArray < 0)) return false; + if (isConstantArray == PT_TRI_YES) return true; + zv::Val keyType = typeOp(member, PT_OP_GET_ITERABLE_KEY_TYPE, "getIterableKeyType"); + if (UNEXPECTED(keyType.isUndef())) return false; + for (zv::Val &otherKeyType : keyTypes) { + zend_long overlaps = isSuperTypeOf(otherKeyType.raw(), keyType.raw()); + if (UNEXPECTED(overlaps < 0)) return false; + if (overlaps != PT_TRI_NO) return true; + } + keyTypes.push_back(std::move(keyType)); + } + + out = std::move(members); + return true; + } + /* enterForeach()'s `foreach ($constantArray as $key => $value)` holders; * UNDEF = pending exception */ static zv::Val addConstantArrayConditionalHolders(zval *scopeArg, StmtParts &parts, zval *constantArray) diff --git a/turbo-ext/src/generated/ForeachHandler.h b/turbo-ext/src/generated/ForeachHandler.h index e5823a228c0..fae77e7e033 100644 --- a/turbo-ext/src/generated/ForeachHandler.h +++ b/turbo-ext/src/generated/ForeachHandler.h @@ -72,15 +72,19 @@ inline constexpr char strings[] = "valueVarName\0" /* 661 */ "addIterateeMemberConditionalHolders\0" /* 674 */ "writesOffsetWithLoopVariable\0" /* 710 */ - "originalStorage\0" /* 739 */ - "tryProcessUnrolledConstantArrayForeach\0" /* 755 */ - "exprType\0" /* 794 */ - "PHPStan\\Analyser\\InternalThrowPoint\0" /* 803 */ - "getTraversableForeachThrowPoint\0" /* 839 */ - "iterableValueType\0" /* 871 */ - "list\0" /* 889 */ - "PhpParser\\Node\\Expr\\List_\0" /* 894 */ - "addDestructureTaggedUnionConditionalHolders"; /* 920 */ + "entryScope\0" /* 739 */ + "iterateeNativeType\0" /* 750 */ + "processByIterateeMember\0" /* 769 */ + "getIterateeMembers\0" /* 793 */ + "originalStorage\0" /* 812 */ + "tryProcessUnrolledConstantArrayForeach\0" /* 828 */ + "exprType\0" /* 867 */ + "PHPStan\\Analyser\\InternalThrowPoint\0" /* 876 */ + "getTraversableForeachThrowPoint\0" /* 912 */ + "iterableValueType\0" /* 944 */ + "list\0" /* 962 */ + "PhpParser\\Node\\Expr\\List_\0" /* 967 */ + "addDestructureTaggedUnionConditionalHolders"; /* 993 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 10), /* __construct $container */ reg::packed(48, MAY_BE_BOOL), /* __construct $implicitThrows */ @@ -113,21 +117,33 @@ inline constexpr reg::PackedArg args[] = { reg::packed(258, 0, 327), /* addIterateeMemberConditionalHolders return */ reg::packed(233, 0, 529), /* writesOffsetWithLoopVariable $stmt */ reg::packed(258, MAY_BE_BOOL), /* writesOffsetWithLoopVariable return */ + reg::packed(268, 0, 286), /* processByIterateeMember $nodeScopeResolver */ + reg::packed(233, 0, 529), /* processByIterateeMember $stmt */ + reg::packed(739, 0, 327), /* processByIterateeMember $entryScope */ + reg::packed(358, 0, 366), /* processByIterateeMember $storage */ + reg::packed(420, 0, 428), /* processByIterateeMember $context */ + reg::packed(558, 0, 571), /* processByIterateeMember $iterateeType */ + reg::packed(750, 0, 571), /* processByIterateeMember $iterateeNativeType */ + reg::packed(258, MAY_BE_NULL, 327), /* processByIterateeMember return */ + reg::packed(321, 0, 327), /* getIterateeMembers $scope */ + reg::packed(621, 0, 630), /* getIterateeMembers $iteratee */ + reg::packed(558, 0, 571), /* getIterateeMembers $iterateeType */ + reg::packed(258, MAY_BE_NULL | MAY_BE_ARRAY), /* getIterateeMembers return */ reg::packed(268, 0, 286), /* tryProcessUnrolledConstantArrayForeach $nodeScopeResolver */ reg::packed(233, 0, 529), /* tryProcessUnrolledConstantArrayForeach $stmt */ reg::packed(515, 0, 327), /* tryProcessUnrolledConstantArrayForeach $originalScope */ - reg::packed(739, 0, 366), /* tryProcessUnrolledConstantArrayForeach $originalStorage */ + reg::packed(812, 0, 366), /* tryProcessUnrolledConstantArrayForeach $originalStorage */ reg::packed(420, 0, 428), /* tryProcessUnrolledConstantArrayForeach $context */ reg::packed(558, 0, 571), /* tryProcessUnrolledConstantArrayForeach $iterateeType */ reg::packed(589, 0, 571), /* tryProcessUnrolledConstantArrayForeach $nativeIterateeType */ reg::packed(258, MAY_BE_NULL | MAY_BE_ARRAY), /* tryProcessUnrolledConstantArrayForeach return */ reg::packed(321, 0, 327), /* getTraversableForeachThrowPoint $scope */ reg::packed(621, 0, 630), /* getTraversableForeachThrowPoint $iteratee */ - reg::packed(794, 0, 571), /* getTraversableForeachThrowPoint $exprType */ - reg::packed(258, MAY_BE_NULL, 803), /* getTraversableForeachThrowPoint return */ + reg::packed(867, 0, 571), /* getTraversableForeachThrowPoint $exprType */ + reg::packed(258, MAY_BE_NULL, 876), /* getTraversableForeachThrowPoint return */ reg::packed(321, 0, 327), /* addDestructureTaggedUnionConditionalHolders $scope */ - reg::packed(871, 0, 571), /* addDestructureTaggedUnionConditionalHolders $iterableValueType */ - reg::packed(889, 0, 894), /* addDestructureTaggedUnionConditionalHolders $list */ + reg::packed(944, 0, 571), /* addDestructureTaggedUnionConditionalHolders $iterableValueType */ + reg::packed(962, 0, 967), /* addDestructureTaggedUnionConditionalHolders $list */ reg::packed(258, 0, 327), /* addDestructureTaggedUnionConditionalHolders return */ }; using Sig = reg::Sig; @@ -141,9 +157,11 @@ inline constexpr sigtab::Sig processStmt = { { 503 /* processStmt */, 6, 7, 6, 1 inline constexpr sigtab::Sig enterForeach = { { 608 /* enterForeach */, 8, 14, 8, 22, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig addIterateeMemberConditionalHolders = { { 674 /* addIterateeMemberConditionalHolders */, 5, 23, 5, 28, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig writesOffsetWithLoopVariable = { { 710 /* writesOffsetWithLoopVariable */, 1, 29, 1, 30, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig tryProcessUnrolledConstantArrayForeach = { { 755 /* tryProcessUnrolledConstantArrayForeach */, 7, 31, 7, 38, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getTraversableForeachThrowPoint = { { 839 /* getTraversableForeachThrowPoint */, 3, 39, 3, 42, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig addDestructureTaggedUnionConditionalHolders = { { 920 /* addDestructureTaggedUnionConditionalHolders */, 3, 43, 3, 46, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig processByIterateeMember = { { 769 /* processByIterateeMember */, 7, 31, 7, 38, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getIterateeMembers = { { 793 /* getIterateeMembers */, 3, 39, 3, 42, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig tryProcessUnrolledConstantArrayForeach = { { 828 /* tryProcessUnrolledConstantArrayForeach */, 7, 43, 7, 50, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getTraversableForeachThrowPoint = { { 912 /* getTraversableForeachThrowPoint */, 3, 51, 3, 54, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig addDestructureTaggedUnionConditionalHolders = { { 993 /* addDestructureTaggedUnionConditionalHolders */, 3, 55, 3, 58, ZEND_ACC_PRIVATE } }; } // namespace sig } // namespace ptdecl::ForeachHandler