diff --git a/src/Analyser/ExpressionTypeHolder.php b/src/Analyser/ExpressionTypeHolder.php index 36f99a85b67..6a8bdb27d7d 100644 --- a/src/Analyser/ExpressionTypeHolder.php +++ b/src/Analyser/ExpressionTypeHolder.php @@ -2,18 +2,33 @@ namespace PHPStan\Analyser; +use PhpParser\Node; use PhpParser\Node\Expr; use PHPStan\TrinaryLogic; use PHPStan\Turbo\ReferencedByTurboExtension; use PHPStan\Turbo\ShadowedByTurboExtension; use PHPStan\Type\Type; use PHPStan\Type\TypeCombinator; +use function array_pop; +use function get_class; +use function is_array; #[ShadowedByTurboExtension(turboClass: 'PHPStanTurbo\ExpressionTypeHolder', implementation: __DIR__ . '/../../turbo-ext/src/ExpressionTypeHolder.cpp')] #[ReferencedByTurboExtension(key: 'expressionTypeHolder')] final class ExpressionTypeHolder { + /** + * The node key of every sub-expression, keyed to the classes it appears + * as - what MutatingScope::shouldInvalidateExpression()'s AST scan + * established per invalidation. Holders are shared across scope copies, + * so the one-time subtree scan amortizes over the many invalidation + * checks against the same holder. + * + * @var array, true>>|null + */ + private ?array $containedNodeKeys = null; + public function __construct( private readonly Expr $expr, private readonly Type $type, @@ -22,6 +37,42 @@ public function __construct( { } + /** + * @param callable(Expr): string $keyBuilder + * @return array, true>> + */ + public function getContainedNodeKeys(callable $keyBuilder): array + { + if ($this->containedNodeKeys !== null) { + return $this->containedNodeKeys; + } + + $keys = []; + $stack = [$this->expr]; + while ($stack !== []) { + $node = array_pop($stack); + if ($node instanceof Expr) { + $keys[$keyBuilder($node)][get_class($node)] = true; + } + foreach ($node->getSubNodeNames() as $subNodeName) { + $subNode = $node->$subNodeName; + if ($subNode instanceof Node) { + $stack[] = $subNode; + } elseif (is_array($subNode)) { + foreach ($subNode as $subNodeItem) { + if (!($subNodeItem instanceof Node)) { + continue; + } + + $stack[] = $subNodeItem; + } + } + } + } + + return $this->containedNodeKeys = $keys; + } + public static function createYes(Expr $expr, Type $type): self { return new self($expr, $type, TrinaryLogic::createYes()); diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index 6a9b1632714..3d7c3e9236e 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -3893,7 +3893,7 @@ private function generalizeVariableTypeHolders( $newVariableTypeHolders = []; foreach ($variableTypeHolders as $variableExprString => $variableTypeHolder) { foreach ($generalizedExpressions as $generalizedExprString => $generalizedExpr) { - if (!ScopeOps::shouldInvalidateExpression($this, $this->exprPrinter, $generalizedExprString, $generalizedExpr, $variableTypeHolder->getExpr(), $variableExprString)) { + if (!ScopeOps::shouldInvalidateExpression($this, $this->exprPrinter, $generalizedExprString, $generalizedExpr, $variableTypeHolder, $variableExprString)) { continue; } diff --git a/src/Analyser/ScopeOps.php b/src/Analyser/ScopeOps.php index e5fb684eadd..0a0cb15ed74 100644 --- a/src/Analyser/ScopeOps.php +++ b/src/Analyser/ScopeOps.php @@ -623,8 +623,7 @@ public static function invalidateExpressionEntries( ) { continue; } - $exprExpr = $exprTypeHolder->getExpr(); - if (!self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $exprExpr, $exprString, $requireMoreCharacters, $invalidatingClass)) { + if (!self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $exprTypeHolder, $exprString, $requireMoreCharacters, $invalidatingClass)) { continue; } @@ -647,8 +646,8 @@ public static function invalidateExpressionEntries( || str_contains($conditionalExprString, $exprStringToInvalidate) || self::keyMayHideSubExpressions($conditionalExprString) ) { - $firstExpr = $holders[array_key_first($holders)]->getTypeHolder()->getExpr(); - if (self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $firstExpr, $conditionalExprString, $requireMoreCharacters, $invalidatingClass)) { + $firstHolder = $holders[array_key_first($holders)]->getTypeHolder(); + if (self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $firstHolder, $conditionalExprString, $requireMoreCharacters, $invalidatingClass)) { $invalidated = true; continue; } @@ -678,7 +677,7 @@ public static function invalidateExpressionEntries( $shouldKeep = true; $conditionalTypeHolders = $holder->getConditionExpressionTypeHolders(); foreach ($conditionalTypeHolders as $conditionalTypeHolderExprString => $conditionalTypeHolder) { - if (self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $conditionalTypeHolder->getExpr(), (string) $conditionalTypeHolderExprString, invalidatingClass: $invalidatingClass)) { + if (self::shouldInvalidateExpression($scope, $exprPrinter, $exprStringToInvalidate, $expressionToInvalidate, $conditionalTypeHolder, (string) $conditionalTypeHolderExprString, invalidatingClass: $invalidatingClass)) { $invalidated = true; $shouldKeep = false; break; @@ -797,10 +796,14 @@ private static function keyMayHideSubExpressions(string $exprString): bool } /** - * Mirrors the former MutatingScope::shouldInvalidateExpression(). + * Answers one (stored holder, invalidated expression) containment check + * from the holder's contained-node-keys index; '$this' invalidations keep + * the finder because they also match self/static/parent and the current + * class name, whose resolution depends on the asking scope. */ - public static function shouldInvalidateExpression(MutatingScope $scope, ExprPrinter $exprPrinter, string $exprStringToInvalidate, Expr $exprToInvalidate, Expr $expr, string $exprString, bool $requireMoreCharacters = false, ?ClassReflection $invalidatingClass = null): bool + public static function shouldInvalidateExpression(MutatingScope $scope, ExprPrinter $exprPrinter, string $exprStringToInvalidate, Expr $exprToInvalidate, ExpressionTypeHolder $exprTypeHolder, string $exprString, bool $requireMoreCharacters = false, ?ClassReflection $invalidatingClass = null): bool { + $expr = $exprTypeHolder->getExpr(); if ( $expr instanceof IntertwinedVariableByReferenceWithExpr && $exprToInvalidate instanceof Variable @@ -852,7 +855,14 @@ public static function shouldInvalidateExpression(MutatingScope $scope, ExprPrin return false; } - if (!self::containsExpressionToInvalidate($scope, $exprPrinter, $expr, get_class($exprToInvalidate), $exprStringToInvalidate)) { + if ($exprStringToInvalidate === '$this') { + // '$this' also matches self/static/parent and the current class name - + // name resolution depends on this scope, so the holder-cached key + // index below cannot answer it + if (!self::containsExpressionToInvalidate($scope, $exprPrinter, $expr, get_class($exprToInvalidate), $exprStringToInvalidate)) { + return false; + } + } elseif (!isset($exprTypeHolder->getContainedNodeKeys(static fn (Expr $node): string => self::nodeKey($node, $exprPrinter))[$exprStringToInvalidate][get_class($exprToInvalidate)])) { return false; } diff --git a/src/Turbo/TurboExtensionEnabler.php b/src/Turbo/TurboExtensionEnabler.php index adeb5659659..4717cffc6a8 100644 --- a/src/Turbo/TurboExtensionEnabler.php +++ b/src/Turbo/TurboExtensionEnabler.php @@ -20,7 +20,7 @@ final class TurboExtensionEnabler * version is the short SHA of the last commit touching turbo-ext/src/, * enforced by the phar.yml turbo-version job. */ - public const EXPECTED_EXTENSION_VERSION = '86312b7'; + public const EXPECTED_EXTENSION_VERSION = '29d230d'; private static bool $typeCombinatorCacheEnabled = false; diff --git a/turbo-ext/src/ArenaCache.dep b/turbo-ext/src/ArenaCache.dep new file mode 100644 index 00000000000..b36a18ca5ff --- /dev/null +++ b/turbo-ext/src/ArenaCache.dep @@ -0,0 +1,86 @@ +src/ArenaCache.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/ArenaCache.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h diff --git a/turbo-ext/src/CombinationsHelper.dep b/turbo-ext/src/CombinationsHelper.dep new file mode 100644 index 00000000000..5e167236d47 --- /dev/null +++ b/turbo-ext/src/CombinationsHelper.dep @@ -0,0 +1,86 @@ +src/CombinationsHelper.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/CombinationsHelper.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/ConditionalExpressionHolder.dep b/turbo-ext/src/ConditionalExpressionHolder.dep new file mode 100644 index 00000000000..f11272f690f --- /dev/null +++ b/turbo-ext/src/ConditionalExpressionHolder.dep @@ -0,0 +1,86 @@ +src/ConditionalExpressionHolder.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/ConditionalExpressionHolder.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/ExpressionResultStorage.dep b/turbo-ext/src/ExpressionResultStorage.dep new file mode 100644 index 00000000000..3f81f628484 --- /dev/null +++ b/turbo-ext/src/ExpressionResultStorage.dep @@ -0,0 +1,86 @@ +src/ExpressionResultStorage.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/ExpressionResultStorage.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/ExpressionTypeHolder.cpp b/turbo-ext/src/ExpressionTypeHolder.cpp index 14dc4823a5d..fbd9c914baa 100644 --- a/turbo-ext/src/ExpressionTypeHolder.cpp +++ b/turbo-ext/src/ExpressionTypeHolder.cpp @@ -32,6 +32,112 @@ class ExpressionTypeHolder obj.propAtWrite(PT_ETH_PROP_CERTAINTY, zv::Val::copyOf(certainty)); } + /* + * Mirrors ExpressionTypeHolder::getContainedNodeKeys(): lazily indexes + * the node keys of every sub-expression of the holder's expr, keyed to + * the classes it appears as. The walk replicates the twin's explicit + * stack (LIFO pop order) so the cached array is key-order identical. + * UNDEF = pending exception. + */ + zv::Val getContainedNodeKeys(zend_fcall_info *fci, zend_fcall_info_cache *fcc) + { + zv::ObjRef obj(self); + zval *cached = obj.propAt(PT_ETH_PROP_CONTAINED_NODE_KEYS).raw(); + if (Z_TYPE_P(cached) == IS_ARRAY) { + return zv::Val::copyOf(zv::Ref(cached)); + } + + zend_class_entry *exprCe = pt_class(PT_CLASS_EXPR); + zend_class_entry *nodeCe = pt_class(PT_CLASS_NODE); + if (UNEXPECTED(exprCe == NULL || nodeCe == NULL)) { + return zv::Val(); + } + + zv::Arr keys = zv::Arr::create(8); + + /* borrowed node pointers — pinned by the expr tree the holder owns */ + uint32_t cap = 32, top = 0; + zend_object **stack = (zend_object **) emalloc(sizeof(*stack) * cap); + stack[top++] = obj.propAt(PT_ETH_PROP_EXPR).deref().asObject(); + + bool failed = false; + while (top > 0) { + zend_object *node = stack[--top]; + + if (instanceof_function(node->ce, exprCe)) { + /* $keys[$keyBuilder($node)][get_class($node)] = true */ + zval arg, retval; + ZVAL_OBJ(&arg, node); + fci->retval = &retval; + fci->param_count = 1; + fci->params = &arg; + fci->named_params = NULL; + if (UNEXPECTED(zend_call_function(fci, fcc) != SUCCESS || EG(exception))) { + failed = true; + break; + } + if (UNEXPECTED(Z_TYPE(retval) != IS_STRING)) { + zval_ptr_dtor(&retval); + zend_throw_error(NULL, "phpstan_turbo: getContainedNodeKeys() keyBuilder must return a string"); + failed = true; + break; + } + zval *innerSlot = zend_symtable_find(keys.table(), Z_STR(retval)); + if (innerSlot == NULL) { + zval innerZv; + array_init(&innerZv); + innerSlot = zend_symtable_update(keys.table(), Z_STR(retval), &innerZv); + } + zval trueZv; + ZVAL_TRUE(&trueZv); + zend_hash_update(Z_ARRVAL_P(innerSlot), node->ce->name, &trueZv); + zval_ptr_dtor(&retval); + } + + pt_node_class_info *info = pt_node_class_info_for_object(node); + if (info == NULL || !PT_HAS_SUBNODES(info)) { + continue; + } + for (uint32_t i = 0; i < info->subnode_count; i++) { + zval *val = OBJ_PROP(node, info->subnode_offsets[i]); + ZVAL_DEREF(val); + if (Z_TYPE_P(val) == IS_OBJECT) { + if (instanceof_function(Z_OBJCE_P(val), nodeCe)) { + if (UNEXPECTED(top == cap)) { + cap *= 2; + stack = (zend_object **) erealloc(stack, sizeof(*stack) * cap); + } + stack[top++] = Z_OBJ_P(val); + } + } else if (Z_TYPE_P(val) == IS_ARRAY) { + zval *el; + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(val), el) { + zval *elDeref = el; + ZVAL_DEREF(elDeref); + if (Z_TYPE_P(elDeref) == IS_OBJECT && instanceof_function(Z_OBJCE_P(elDeref), nodeCe)) { + if (UNEXPECTED(top == cap)) { + cap *= 2; + stack = (zend_object **) erealloc(stack, sizeof(*stack) * cap); + } + stack[top++] = Z_OBJ_P(elDeref); + } + } ZEND_HASH_FOREACH_END(); + } + } + } + efree(stack); + + if (UNEXPECTED(failed)) { + return zv::Val(); + } + + /* $this->containedNodeKeys = $keys (cache), then return it */ + zval *slot = obj.propAt(PT_ETH_PROP_CONTAINED_NODE_KEYS).raw(); + zval_ptr_dtor(slot); + ZVAL_COPY(slot, keys.raw()); + return zv::Val(std::move(keys)); + } + static zv::Val createYes(zval *expr, zval *type) { zval holder; @@ -89,6 +195,7 @@ void pt_register_expression_type_holder() cls.privateNullProperty("expr"); cls.privateNullProperty("type"); cls.privateNullProperty("certainty"); + cls.privateNullProperty("containedNodeKeys"); cls.method("__construct", reg::Public, 3, { reg::any("expr"), reg::any("type"), reg::obj("certainty", TRINARY_CLASS) }, [](INTERNAL_FUNCTION_PARAMETERS) { zval *expr, *type, *certainty; @@ -100,6 +207,19 @@ void pt_register_expression_type_holder() ExpressionTypeHolder(ZEND_THIS).construct(zv::Ref(expr), zv::Ref(type), zv::Ref(certainty)); }); + cls.method("getContainedNodeKeys", reg::Public, 1, { reg::callableArg("keyBuilder") }, [](INTERNAL_FUNCTION_PARAMETERS) { + zend_fcall_info fci; + zend_fcall_info_cache fcc; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_FUNC(fci, fcc) + ZEND_PARSE_PARAMETERS_END(); + zv::Val result = ExpressionTypeHolder(ZEND_THIS).getContainedNodeKeys(&fci, &fcc); + if (UNEXPECTED(result.isUndef())) { + RETURN_THROWS(); + } + result.intoReturnValue(return_value); + }); + cls.method("createYes", reg::PublicStatic, 2, { reg::any("expr"), reg::any("type") }, [](INTERNAL_FUNCTION_PARAMETERS) { zval *expr, *type; ZEND_PARSE_PARAMETERS_START(2, 2) diff --git a/turbo-ext/src/ExpressionTypeHolder.dep b/turbo-ext/src/ExpressionTypeHolder.dep new file mode 100644 index 00000000000..2b8e3a3cbfb --- /dev/null +++ b/turbo-ext/src/ExpressionTypeHolder.dep @@ -0,0 +1,86 @@ +src/ExpressionTypeHolder.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/ExpressionTypeHolder.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/NodeScanner.dep b/turbo-ext/src/NodeScanner.dep new file mode 100644 index 00000000000..2d0d20e238a --- /dev/null +++ b/turbo-ext/src/NodeScanner.dep @@ -0,0 +1,86 @@ +src/NodeScanner.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/NodeScanner.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/NodeTraverser.dep b/turbo-ext/src/NodeTraverser.dep new file mode 100644 index 00000000000..b3ece530587 --- /dev/null +++ b/turbo-ext/src/NodeTraverser.dep @@ -0,0 +1,86 @@ +src/NodeTraverser.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/NodeTraverser.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/ScopeOps.cpp b/turbo-ext/src/ScopeOps.cpp index 307f228b36d..f5a40736a5d 100644 --- a/turbo-ext/src/ScopeOps.cpp +++ b/turbo-ext/src/ScopeOps.cpp @@ -816,10 +816,9 @@ class ScopeOps if (UNEXPECTED(!pt_check_holder(holder.raw()))) { return zv::Val(); } - zend_object *expr = holderExpr(holder); zend_string *entryKey = key != NULL ? key : zend_long_to_str((zend_long) idx); bool failed = false; - bool should = shouldInvalidate(query, entryKey, expr, requireMoreCharacters, &failed); + bool should = shouldInvalidate(query, entryKey, holder.asObject(), requireMoreCharacters, &failed); if (key == NULL) { zend_string_release(entryKey); } @@ -866,10 +865,13 @@ class ScopeOps zend_type_error("phpstan_turbo: expected ConditionalExpressionHolder"); return zv::Val(); } - zend_object *firstExpr = holderExpr(zv::ObjRef(firstHolder.asObject()).propAt(PT_CEH_PROP_TYPEHOLDER)); + zv::Ref firstTypeHolder = zv::ObjRef(firstHolder.asObject()).propAt(PT_CEH_PROP_TYPEHOLDER).deref(); + if (UNEXPECTED(!pt_check_holder(firstTypeHolder.raw()))) { + return zv::Val(); + } zend_string *entryKey = key != NULL ? key : zend_long_to_str((zend_long) idx); bool failed = false; - bool drop = shouldInvalidate(query, entryKey, firstExpr, requireMoreCharacters, &failed); + bool drop = shouldInvalidate(query, entryKey, firstTypeHolder.asObject(), requireMoreCharacters, &failed); if (key == NULL) { zend_string_release(entryKey); } @@ -918,11 +920,10 @@ class ScopeOps if (UNEXPECTED(!pt_check_holder(conditionHolder.raw()))) { return zv::Val(); } - zend_object *conditionExpr = holderExpr(conditionHolder); zend_string *conditionKey = conditionEntry.stringKeyOrNull(); zend_string *conditionKeyStr = conditionKey != NULL ? conditionKey : zend_long_to_str((zend_long) conditionEntry.indexKey()); bool failed = false; - bool should = shouldInvalidate(query, conditionKeyStr, conditionExpr, false, &failed); + bool should = shouldInvalidate(query, conditionKeyStr, conditionHolder.asObject(), false, &failed); if (conditionKey == NULL) { zend_string_release(conditionKeyStr); } @@ -1060,7 +1061,7 @@ class ScopeOps } /* Mirrors ScopeOps::shouldInvalidateExpression(). */ - static bool shouldInvalidateExpression(zval *scope, zval *exprPrinter, zend_string *exprStringToInvalidate, zval *exprToInvalidate, zend_object *expr, zend_string *exprString, bool requireMoreCharacters, zval *invalidatingClass, bool *failed) + static bool shouldInvalidateExpression(zval *scope, zval *exprPrinter, zend_string *exprStringToInvalidate, zval *exprToInvalidate, zend_object *exprTypeHolder, zend_string *exprString, bool requireMoreCharacters, zval *invalidatingClass, bool *failed) { InvalidationQuery query = { scope, @@ -1070,7 +1071,7 @@ class ScopeOps invalidatingClass, zend_string_equals_literal(exprStringToInvalidate, "$this"), }; - return shouldInvalidate(query, exprString, expr, requireMoreCharacters, failed); + return shouldInvalidate(query, exprString, exprTypeHolder, requireMoreCharacters, failed); } /* Mirrors ScopeOps::getIntertwinedRefRootVariableName(). */ @@ -1825,8 +1826,13 @@ class ScopeOps * per-call (the conditional-holder scan passes false). Returns false and * sets *failed on exception. */ - static bool shouldInvalidate(const InvalidationQuery &query, zend_string *exprString, zend_object *expr, bool requireMoreCharacters, bool *failed) + static bool shouldInvalidate(const InvalidationQuery &query, zend_string *exprString, zend_object *holderObj, bool requireMoreCharacters, bool *failed) { + zend_object *expr; + { + zv::Ref exprRef = zv::ObjRef(holderObj).propAt(PT_ETH_PROP_EXPR).deref(); + expr = exprRef.asObject(); + } zend_class_entry *variableCe = pt_class(PT_CLASS_VARIABLE); zend_class_entry *intertwinedCe = pt_class(PT_CLASS_INTERTWINED_VAR); @@ -1908,8 +1914,10 @@ class ScopeOps return false; } - /* AST walk */ - { + if (query.isThis) { + /* '$this' also matches self/static/parent and the current class + * name - name resolution depends on the asking scope, so the + * holder-cached key index below cannot answer it */ pt_find_ctx ctx; memset(&ctx, 0, sizeof(ctx)); ctx.target_ce = Z_OBJCE_P(query.expressionToInvalidate); @@ -1932,6 +1940,22 @@ class ScopeOps if (found == NULL) { return false; } + } else { + /* one isset() on the holder's contained-node-keys index instead + * of the subtree scan */ + HashTable *contained = pt_holder_contained_node_keys(holderObj, query.exprPrinter); + if (UNEXPECTED(contained == NULL)) { + *failed = true; + return false; + } + zval *inner = zend_symtable_find(contained, query.exprStringToInvalidate); + if (inner == NULL) { + return false; + } + ZVAL_DEREF(inner); + if (Z_TYPE_P(inner) != IS_ARRAY || zend_hash_find(Z_ARRVAL_P(inner), Z_OBJCE_P(query.expressionToInvalidate)->name) == NULL) { + return false; + } } /* Post-checks calling back into the scope (rare paths) */ @@ -2173,8 +2197,8 @@ void pt_register_scope_ops() result.intoReturnValue(return_value); }); - cls.method("shouldInvalidateExpression", reg::PublicStatic, 6, { reg::objectArg("scope"), reg::objectArg("exprPrinter"), reg::stringArg("exprStringToInvalidate"), reg::objectArg("exprToInvalidate"), reg::objectArg("expr"), reg::stringArg("exprString"), reg::boolArg("requireMoreCharacters"), reg::objectArg("invalidatingClass", true) }, [](INTERNAL_FUNCTION_PARAMETERS) { - zval *scope, *expr_printer, *expr_to_invalidate, *expr, *invalidating_class = NULL; + cls.method("shouldInvalidateExpression", reg::PublicStatic, 6, { reg::objectArg("scope"), reg::objectArg("exprPrinter"), reg::stringArg("exprStringToInvalidate"), reg::objectArg("exprToInvalidate"), reg::objectArg("exprTypeHolder"), reg::stringArg("exprString"), reg::boolArg("requireMoreCharacters"), reg::objectArg("invalidatingClass", true) }, [](INTERNAL_FUNCTION_PARAMETERS) { + zval *scope, *expr_printer, *expr_to_invalidate, *expr_type_holder, *invalidating_class = NULL; zend_string *invalidate_str, *expr_string; bool require_more_characters = false; ZEND_PARSE_PARAMETERS_START(6, 8) @@ -2182,15 +2206,18 @@ void pt_register_scope_ops() Z_PARAM_OBJECT(expr_printer) Z_PARAM_STR(invalidate_str) Z_PARAM_OBJECT(expr_to_invalidate) - Z_PARAM_OBJECT(expr) + Z_PARAM_OBJECT(expr_type_holder) Z_PARAM_STR(expr_string) Z_PARAM_OPTIONAL Z_PARAM_BOOL(require_more_characters) Z_PARAM_OBJECT_OR_NULL(invalidating_class) ZEND_PARSE_PARAMETERS_END(); pt_init_strs(); + if (UNEXPECTED(!pt_check_holder(expr_type_holder))) { + RETURN_THROWS(); + } bool failed = false; - bool result = ScopeOps::shouldInvalidateExpression(scope, expr_printer, invalidate_str, expr_to_invalidate, Z_OBJ_P(expr), expr_string, require_more_characters, invalidating_class, &failed); + bool result = ScopeOps::shouldInvalidateExpression(scope, expr_printer, invalidate_str, expr_to_invalidate, Z_OBJ_P(expr_type_holder), expr_string, require_more_characters, invalidating_class, &failed); if (UNEXPECTED(failed)) { RETURN_THROWS(); } diff --git a/turbo-ext/src/ScopeOps.dep b/turbo-ext/src/ScopeOps.dep new file mode 100644 index 00000000000..f3e8a5ed0f8 --- /dev/null +++ b/turbo-ext/src/ScopeOps.dep @@ -0,0 +1,86 @@ +src/ScopeOps.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/ScopeOps.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/TrinaryLogic.dep b/turbo-ext/src/TrinaryLogic.dep new file mode 100644 index 00000000000..2f25ce03710 --- /dev/null +++ b/turbo-ext/src/TrinaryLogic.dep @@ -0,0 +1,86 @@ +src/TrinaryLogic.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/TrinaryLogic.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/TypeCombinatorCache.dep b/turbo-ext/src/TypeCombinatorCache.dep new file mode 100644 index 00000000000..76675440852 --- /dev/null +++ b/turbo-ext/src/TypeCombinatorCache.dep @@ -0,0 +1,87 @@ +src/TypeCombinatorCache.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/TypeCombinatorCache.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/zv.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_weakrefs.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/main.dep b/turbo-ext/src/main.dep new file mode 100644 index 00000000000..0e1f3bd58b6 --- /dev/null +++ b/turbo-ext/src/main.dep @@ -0,0 +1,85 @@ +src/main.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/main.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/reg.h diff --git a/turbo-ext/src/parser/ParserRunner.dep b/turbo-ext/src/parser/ParserRunner.dep new file mode 100644 index 00000000000..d06bce3c03f --- /dev/null +++ b/turbo-ext/src/parser/ParserRunner.dep @@ -0,0 +1,90 @@ +src/parser/ParserRunner.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserRunner.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserEngine.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../zv.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserRunnerActionsSplit.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/ext/spl/spl_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_language_parser.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../reg.h diff --git a/turbo-ext/src/parser/ParserRunnerActions1.dep b/turbo-ext/src/parser/ParserRunnerActions1.dep new file mode 100644 index 00000000000..0bf6257dc17 --- /dev/null +++ b/turbo-ext/src/parser/ParserRunnerActions1.dep @@ -0,0 +1,86 @@ +src/parser/ParserRunnerActions1.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserRunnerActions1.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserEngine.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../zv.h diff --git a/turbo-ext/src/parser/ParserRunnerActions2.dep b/turbo-ext/src/parser/ParserRunnerActions2.dep new file mode 100644 index 00000000000..1a90948e8aa --- /dev/null +++ b/turbo-ext/src/parser/ParserRunnerActions2.dep @@ -0,0 +1,86 @@ +src/parser/ParserRunnerActions2.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserRunnerActions2.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserEngine.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../zv.h diff --git a/turbo-ext/src/parser/ParserRunnerActions3.dep b/turbo-ext/src/parser/ParserRunnerActions3.dep new file mode 100644 index 00000000000..25b4e5271ea --- /dev/null +++ b/turbo-ext/src/parser/ParserRunnerActions3.dep @@ -0,0 +1,86 @@ +src/parser/ParserRunnerActions3.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserRunnerActions3.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserEngine.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../zv.h diff --git a/turbo-ext/src/parser/ParserRunnerHelpers.dep b/turbo-ext/src/parser/ParserRunnerHelpers.dep new file mode 100644 index 00000000000..127ce6a883d --- /dev/null +++ b/turbo-ext/src/parser/ParserRunnerHelpers.dep @@ -0,0 +1,86 @@ +src/parser/ParserRunnerHelpers.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserRunnerHelpers.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/ParserEngine.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/parser/../zv.h diff --git a/turbo-ext/src/support.cpp b/turbo-ext/src/support.cpp index 0fad5118070..b4365ac7345 100644 --- a/turbo-ext/src/support.cpp +++ b/turbo-ext/src/support.cpp @@ -919,3 +919,91 @@ zend_string *pt_ceh_key_build(HashTable *conds, zval *type_holder) } /* }}} */ + +HashTable *pt_holder_contained_node_keys(zend_object *holder, zval *expr_printer) +{ + zval *slot = OBJ_PROP_NUM(holder, PT_ETH_PROP_CONTAINED_NODE_KEYS); + if (Z_TYPE_P(slot) == IS_ARRAY) { + return Z_ARRVAL_P(slot); + } + + zend_class_entry *expr_ce = pt_class(PT_CLASS_EXPR); + zend_class_entry *node_ce = pt_class(PT_CLASS_NODE); + if (UNEXPECTED(expr_ce == NULL || node_ce == NULL)) { + return NULL; + } + + zval keys; + array_init(&keys); + + /* the twin's explicit stack (LIFO pop order) so the cached array is + * key-order identical to ExpressionTypeHolder::getContainedNodeKeys() */ + uint32_t cap = 32, top = 0; + zend_object **stack = (zend_object **) emalloc(sizeof(*stack) * cap); + { + zval *expr_slot = OBJ_PROP_NUM(holder, PT_ETH_PROP_EXPR); + ZVAL_DEREF(expr_slot); + stack[top++] = Z_OBJ_P(expr_slot); + } + + while (top > 0) { + zend_object *node = stack[--top]; + + if (instanceof_function(node->ce, expr_ce)) { + zend_string *key = pt_node_key(node, expr_printer); + if (UNEXPECTED(key == NULL)) { + efree(stack); + zval_ptr_dtor(&keys); + return NULL; + } + zval *inner = zend_symtable_find(Z_ARRVAL(keys), key); + if (inner == NULL) { + zval inner_zv; + array_init(&inner_zv); + inner = zend_symtable_update(Z_ARRVAL(keys), key, &inner_zv); + } + zval true_zv; + ZVAL_TRUE(&true_zv); + zend_hash_update(Z_ARRVAL_P(inner), node->ce->name, &true_zv); + zend_string_release(key); + } + + pt_node_class_info *info = pt_node_class_info_for_object(node); + if (info == NULL || !PT_HAS_SUBNODES(info)) { + continue; + } + for (uint32_t i = 0; i < info->subnode_count; i++) { + zval *val = OBJ_PROP(node, info->subnode_offsets[i]); + ZVAL_DEREF(val); + if (Z_TYPE_P(val) == IS_OBJECT) { + if (instanceof_function(Z_OBJCE_P(val), node_ce)) { + if (UNEXPECTED(top == cap)) { + cap *= 2; + stack = (zend_object **) erealloc(stack, sizeof(*stack) * cap); + } + stack[top++] = Z_OBJ_P(val); + } + } else if (Z_TYPE_P(val) == IS_ARRAY) { + zval *el; + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(val), el) { + zval *el_deref = el; + ZVAL_DEREF(el_deref); + if (Z_TYPE_P(el_deref) == IS_OBJECT && instanceof_function(Z_OBJCE_P(el_deref), node_ce)) { + if (UNEXPECTED(top == cap)) { + cap *= 2; + stack = (zend_object **) erealloc(stack, sizeof(*stack) * cap); + } + stack[top++] = Z_OBJ_P(el_deref); + } + } ZEND_HASH_FOREACH_END(); + } + } + } + efree(stack); + + /* cache in the holder's slot (transfers ownership) and hand out the table */ + zval_ptr_dtor(slot); + ZVAL_COPY_VALUE(slot, &keys); + return Z_ARRVAL_P(slot); +} + diff --git a/turbo-ext/src/support.dep b/turbo-ext/src/support.dep new file mode 100644 index 00000000000..375c904c581 --- /dev/null +++ b/turbo-ext/src/support.dep @@ -0,0 +1,84 @@ +src/support.lo: \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.cpp \ + /Users/ondrej/Development/phpstan/.claude/worktrees/scopeops-invalidation/turbo-ext/src/support.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_version.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_types.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_portability.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/../main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/../TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_config.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_range_check.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_long.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_map_ptr.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_errors.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_alloc_sizes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_llist.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_string.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_gc.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hrtime.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_hash.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_sort.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ast.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_variables.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_iterators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stream.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_string_public.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_signal.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_max_execution_timer.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_object_handlers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_property_hooks.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_lazy_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_operators.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_strtod.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multiply.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_compat.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_modules.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_compile.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_vm_opcodes.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_frameless_function.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_globals_macros.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_atomic.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ptr_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_objects_API.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_float.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_multibyte.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_arena.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_call_stack.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_build.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_list.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_execute.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_constants.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_type_info.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/build-defs.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/snprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/spprintf.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_syslog.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_output.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_context.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_filter_api.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_transport.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_plain_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_glob_wrapper.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_userspace.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/streams/php_stream_mmap.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_memory_streams.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/fopen_wrappers.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_globals.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_ini.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_virtual_cwd.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/TSRM/TSRM.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/main/php_reentrancy.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_exceptions.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_interfaces.h \ + /opt/homebrew/Cellar/php/8.5.5_1/include/php/Zend/zend_smart_str.h diff --git a/turbo-ext/src/support.h b/turbo-ext/src/support.h index 77c08a77081..f237f36fcd8 100644 --- a/turbo-ext/src/support.h +++ b/turbo-ext/src/support.h @@ -173,6 +173,7 @@ void pt_arena_mshutdown(); #define PT_ETH_PROP_EXPR 0 #define PT_ETH_PROP_TYPE 1 #define PT_ETH_PROP_CERTAINTY 2 +#define PT_ETH_PROP_CONTAINED_NODE_KEYS 3 #define PT_CEH_PROP_CONDS 0 #define PT_CEH_PROP_TYPEHOLDER 1 @@ -301,6 +302,11 @@ typedef bool (*pt_node_matcher)(zend_object *node, void *ctx); zend_object *pt_find_first_recursive(zend_object *node, pt_node_matcher matcher, void *ctx); +/* The holder's contained-node-keys index built with the native node-key + * builder, cached in the holder's containedNodeKeys slot. Borrowed table; + * NULL on failure (exception thrown). */ +HashTable *pt_holder_contained_node_keys(zend_object *holder, zval *expr_printer); + bool pt_is_superglobal_name(zend_string *name); /* CONTAINS_SUPER_GLOBAL_ATTRIBUTE_NAME-cached superglobal scan */ bool pt_expr_contains_superglobal(zend_object *expr); diff --git a/turbo-ext/tests/smoke.php b/turbo-ext/tests/smoke.php index e668d303440..ec0c1163100 100644 --- a/turbo-ext/tests/smoke.php +++ b/turbo-ext/tests/smoke.php @@ -337,6 +337,29 @@ function check(bool $cond, string $msg): void check($storage->pendingFibers === [], "ERS $label: fiber array entries can be unset"); } +// getContainedNodeKeys: identical index (including key insertion order) over the same tree +$tree = new \PhpParser\Node\Expr\BinaryOp\Plus( + new \PhpParser\Node\Expr\Variable('a'), + new \PhpParser\Node\Expr\ArrayDimFetch( + new \PhpParser\Node\Expr\Variable('b'), + new \PhpParser\Node\Scalar\String_('k'), + ), +); +$keyBuilder = static fn (\PhpParser\Node\Expr $e): string => $e instanceof \PhpParser\Node\Expr\Variable && is_string($e->name) + ? '$' . $e->name + : get_class($e) . '#' . spl_object_id($e); +$pContained = $pH($tree, $int, $pYes)->getContainedNodeKeys($keyBuilder); +$nContainedHolder = $nH($tree, $int, $nYes); +$nContained = $nContainedHolder->getContainedNodeKeys($keyBuilder); +check($pContained === $nContained, 'ETH getContainedNodeKeys parity: ' . json_encode($pContained) . ' vs ' . json_encode($nContained)); +$counter = 0; +$countingBuilder = static function (\PhpParser\Node\Expr $e) use (&$counter, $keyBuilder): string { + $counter++; + return $keyBuilder($e); +}; +$nContainedHolder->getContainedNodeKeys($countingBuilder); +check($counter === 0, 'ETH getContainedNodeKeys memoizes (keyBuilder not re-invoked)'); + // ---- ScopeOps::mergeVariableHolders differingKeys ---- $sharedP = $pH($expr1, $int, $pYes); $sharedN = $nH($expr1, $int, $nYes);