diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index bf19f368357..267120f7838 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -79,6 +79,7 @@ use PHPStan\Type\Constant\ConstantStringType; use PHPStan\Type\ConstantTypeHelper; use PHPStan\Type\ErrorType; +use PHPStan\Type\FloatRangeType; use PHPStan\Type\GeneralizePrecision; use PHPStan\Type\Generic\TemplateTypeHelper; use PHPStan\Type\Generic\TemplateTypeMap; @@ -122,8 +123,10 @@ use function get_class; use function implode; use function in_array; +use function is_nan; use function is_string; use function ltrim; +use function max; use function md5; use function min; use function preg_match; @@ -136,6 +139,8 @@ use function substr; use function uksort; use function usort; +use const INF; +use const NAN; use const PHP_INT_MAX; use const PHP_INT_MIN; @@ -5218,7 +5223,6 @@ private function generalizeType(Type $a, Type $b, int $depth): Type $resultTypes = []; foreach ([ - $constantFloats, $constantBooleans, $constantStrings, ] as $constantTypes) { @@ -5378,6 +5382,16 @@ private function generalizeType(Type $a, Type $b, int $depth): Type $resultTypes[] = TypeCombinator::union(...$generalArrays['b']); } + if (count($constantFloats['a']) > 0) { + if (count($constantFloats['b']) === 0) { + $resultTypes[] = TypeCombinator::union(...$constantFloats['a']); + } else { + $resultTypes[] = $this->generalizeConstantFloats($constantFloats['a'], $constantFloats['b']); + } + } elseif (count($constantFloats['b']) > 0) { + $resultTypes[] = TypeCombinator::union(...$constantFloats['b']); + } + if (count($constantIntegers['a']) > 0) { if (count($constantIntegers['b']) === 0) { $resultTypes[] = TypeCombinator::union(...$constantIntegers['a']); @@ -5534,6 +5548,77 @@ private function generalizeType(Type $a, Type $b, int $depth): Type ), ...$otherTypes); } + /** + * Constant floats widen like the constant integers in generalizeType(): a + * bound that moved between the iterations is opened. NAN has no place in + * the order, so it is set aside and added back to the result. + * + * @param non-empty-list $a + * @param non-empty-list $b + */ + private function generalizeConstantFloats(array $a, array $b): Type + { + $constantFloatsA = TypeCombinator::union(...$a); + $constantFloatsB = TypeCombinator::union(...$b); + if ($constantFloatsA->equals($constantFloatsB)) { + return $constantFloatsA; + } + + $hasNan = false; + $orderedA = []; + foreach ($a as $float) { + if (is_nan($float->getValue())) { + $hasNan = true; + continue; + } + $orderedA[] = $float; + } + $orderedB = []; + foreach ($b as $float) { + if (is_nan($float->getValue())) { + $hasNan = true; + continue; + } + $orderedB[] = $float; + } + + if ($orderedA === [] || $orderedB === []) { + $result = TypeCombinator::union(...$orderedA, ...$orderedB); + } else { + $min = INF; + $max = -INF; + foreach ($orderedA as $float) { + $min = min($min, $float->getValue()); + $max = max($max, $float->getValue()); + } + + $newMin = $min; + $newMax = $max; + foreach ($orderedB as $float) { + $newMin = min($newMin, $float->getValue()); + $newMax = max($newMax, $float->getValue()); + } + + $gotGreater = $newMax > $max; + $gotSmaller = $newMin < $min; + if ($gotGreater && $gotSmaller) { + $result = FloatRangeType::fromInterval($newMin, $newMax); + } elseif ($gotGreater) { + $result = FloatRangeType::fromInterval($min, INF); + } elseif ($gotSmaller) { + $result = FloatRangeType::fromInterval(-INF, $max); + } else { + $result = TypeCombinator::union(...$orderedA, ...$orderedB); + } + } + + if ($hasNan) { + return TypeCombinator::union($result, new ConstantFloatType(NAN)); + } + + return $result; + } + private static function getArrayDepth(Type $type): int { $depth = 0; diff --git a/tests/PHPStan/Analyser/nsrt/float-constant-loop-generalize.php b/tests/PHPStan/Analyser/nsrt/float-constant-loop-generalize.php new file mode 100644 index 00000000000..46ac7244449 --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/float-constant-loop-generalize.php @@ -0,0 +1,94 @@ + $items */ +function constantStep(array $items): void +{ + $total = 0.0; + foreach ($items as $item) { + $total += 1.5; + } + assertType('0.0|1.5|float<3.0, max>', $total); + takesNonNegativeFloat($total); + + $count = 0; + foreach ($items as $item) { + $count += 2; + } + assertType('0|2|int<4, max>', $count); + takesNonNegativeInt($count); +} + +function counter(int $limit): void +{ + for ($x = 0.0; $x < $limit; $x += 0.25) { + assertType('0.0|float<0.25, max>', $x); + } + + for ($i = 0; $i < $limit; $i += 1) { + assertType('int<0, max>', $i); + } +} + +/** @param list $items */ +function decreasing(array $items): void +{ + $budget = 10.0; + foreach ($items as $item) { + $budget -= 0.5; + } + assertType('9.5|10.0|float', $budget); +} + +/** @param list $items */ +function halving(array $items): void +{ + $size = 1.0; + foreach ($items as $item) { + $size /= 2; + } + assertType('0.5|1.0|float', $size); +} + +/** @param list $items */ +function withNan(array $items, bool $b): void +{ + $value = $b ? NAN : 0.0; + foreach ($items as $item) { + $value += 1.0; + } + assertType('0.0|1.0|NAN|float<2.0, max>', $value); +} + +/** @param list $items */ +function onlyNan(array $items): void +{ + $value = NAN; + foreach ($items as $item) { + $value = 2.0; + } + assertType('2.0|NAN', $value); +} + +/** @param list $items */ +function toggled(array $items): void +{ + $sign = 1.0; + foreach ($items as $item) { + $sign = -$sign; + } + assertType('float', $sign); +} diff --git a/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php b/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php index 2e6c6668c23..1c60a43a4b6 100644 --- a/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php +++ b/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php @@ -171,11 +171,19 @@ public function testStrictComparison(): void 368, ], [ - 'Strict comparison using === between float and \'string\' will always evaluate to false.', + 'Strict comparison using === between 2.0|float and 1000000.0 will always evaluate to false.', + 383, + ], + [ + 'Strict comparison using === between 2.0|float and \'string\' will always evaluate to false.', 386, ], [ - 'Strict comparison using === between float and \'string\' will always evaluate to false.', + 'Strict comparison using === between 2.0|10.0|float and 1000000.0 will always evaluate to false.', + 391, + ], + [ + 'Strict comparison using === between 2.0|10.0|float and \'string\' will always evaluate to false.', 394, ], [ diff --git a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php index 8b60dce77cd..cbc050bdcb5 100644 --- a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php +++ b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php @@ -3664,4 +3664,9 @@ public function testUnknownDefaultValue(): void ]); } + public function testFloatConstantLoopGeneralize(): void + { + $this->analyse([__DIR__ . '/../../Analyser/nsrt/float-constant-loop-generalize.php'], []); + } + } diff --git a/turbo-ext/src/MutatingScope.cpp b/turbo-ext/src/MutatingScope.cpp index 3f1097828e0..888eb5cf9a2 100644 --- a/turbo-ext/src/MutatingScope.cpp +++ b/turbo-ext/src/MutatingScope.cpp @@ -287,6 +287,7 @@ extern "C" { #include "zend_smart_str.h" #include +#include #include zend_class_entry *pt_ce_mutating_scope = nullptr; @@ -9412,6 +9413,72 @@ class MutatingScope /* the 'a' / 'b' pair of type lists generalizeType() sorts its inputs * into (the twin's `['a' => [], 'b' => []]`) */ + /* private (twin generalizeConstantFloats()) — constant floats widen + * like constant integers, NAN set aside; UNDEF = pending exception */ + zv::Val generalizeConstantFloats(HashTable *a, HashTable *b) + { + zv::Val constantFloatsA = unionOfList(a); + if (UNEXPECTED(constantFloatsA.isUndef())) return zv::Val(); + zv::Val constantFloatsB = unionOfList(b); + if (UNEXPECTED(constantFloatsB.isUndef())) return zv::Val(); + bool same; + if (UNEXPECTED(!typeEquals(constantFloatsA.raw(), constantFloatsB.raw(), same))) return zv::Val(); + if (same) return constantFloatsA; + + bool hasNan = false; + zv::Arr ordered[2] = { zv::Arr::create(0), zv::Arr::create(0) }; + HashTable *sides[2] = { a, b }; + for (int side = 0; side < 2; side++) { + for (auto entry : zv::TableRef(sides[side])) { + double value; + if (UNEXPECTED(!pt_constant_float_get_value(entry.value().deref().asObject(), value))) return zv::Val(); + if (std::isnan(value)) { + hasNan = true; + continue; + } + ordered[side].push(entry.value().deref()); + } + } + + zv::Val result; + if (zend_hash_num_elements(ordered[0].table()) == 0 || zend_hash_num_elements(ordered[1].table()) == 0) { + result = unionOfLists(ordered[0].table(), ordered[1].table()); + } else { + double min = INFINITY, max = -INFINITY; + for (auto entry : zv::TableRef(ordered[0].table())) { + double value; + if (UNEXPECTED(!pt_constant_float_get_value(entry.value().deref().asObject(), value))) return zv::Val(); + if (value < min) min = value; + if (value > max) max = value; + } + double newMin = min, newMax = max; + for (auto entry : zv::TableRef(ordered[1].table())) { + double value; + if (UNEXPECTED(!pt_constant_float_get_value(entry.value().deref().asObject(), value))) return zv::Val(); + if (value < newMin) newMin = value; + if (value > newMax) newMax = value; + } + + bool gotGreater = newMax > max; + bool gotSmaller = newMin < min; + if (gotGreater && gotSmaller) { + result = pt_float_range_from_interval(newMin, newMax); + } else if (gotGreater) { + result = pt_float_range_from_interval(min, INFINITY); + } else if (gotSmaller) { + result = pt_float_range_from_interval(-INFINITY, max); + } else { + result = unionOfLists(ordered[0].table(), ordered[1].table()); + } + } + if (UNEXPECTED(result.isUndef())) return zv::Val(); + + if (!hasNan) return result; + zv::Val nan = pt_type_new_constant_float(NAN); + if (UNEXPECTED(nan.isUndef())) return zv::Val(); + return unionTypes(result.raw(), nan.raw()); + } + struct GeneralizeBucket { zv::Arr list[2]; @@ -9538,8 +9605,8 @@ class MutatingScope } zv::Arr resultTypes = zv::Arr::create(0); - GeneralizeBucket *scalarBuckets[3] = { &constantFloats, &constantBooleans, &constantStrings }; - for (uint32_t i = 0; i < 3; i++) { + GeneralizeBucket *scalarBuckets[2] = { &constantBooleans, &constantStrings }; + for (uint32_t i = 0; i < 2; i++) { GeneralizeBucket &bucket = *scalarBuckets[i]; if (bucket.count(0) == 0) { if (bucket.count(1) > 0) { @@ -9806,6 +9873,18 @@ class MutatingScope resultTypes.push(std::move(united)); } + if (constantFloats.count(0) > 0) { + zv::Val united = constantFloats.count(1) == 0 + ? unionOfList(constantFloats.table(0)) + : generalizeConstantFloats(constantFloats.table(0), constantFloats.table(1)); + if (UNEXPECTED(united.isUndef())) return zv::Val(); + resultTypes.push(std::move(united)); + } else if (constantFloats.count(1) > 0) { + zv::Val united = unionOfList(constantFloats.table(1)); + if (UNEXPECTED(united.isUndef())) return zv::Val(); + resultTypes.push(std::move(united)); + } + if (constantIntegers.count(0) > 0) { if (constantIntegers.count(1) == 0) { zv::Val united = unionOfList(constantIntegers.table(0)); diff --git a/turbo-ext/src/generated/MutatingScope.h b/turbo-ext/src/generated/MutatingScope.h index 131a3f51ec1..b0140f15e1c 100644 --- a/turbo-ext/src/generated/MutatingScope.h +++ b/turbo-ext/src/generated/MutatingScope.h @@ -444,68 +444,69 @@ inline constexpr char strings[] = "b\0" /* 7703 */ "depth\0" /* 7705 */ "generalizeType\0" /* 7711 */ - "getArrayDepth\0" /* 7726 */ - "equals\0" /* 7740 */ - "otherConditionalExpressions\0" /* 7747 */ - "compareConditionalExpressions\0" /* 7775 */ - "compareVariableTypeHolders\0" /* 7805 */ - "propertyReflection\0" /* 7832 */ - "PHPStan\\Reflection\\PropertyReflection\0" /* 7851 */ - "canAccessProperty\0" /* 7889 */ - "PHPStan\\Reflection\\ExtendedPropertyReflection\0" /* 7907 */ - "canReadProperty\0" /* 7953 */ - "canWriteProperty\0" /* 7969 */ - "methodReflection\0" /* 7986 */ - "PHPStan\\Reflection\\MethodReflection\0" /* 8003 */ - "canCallMethod\0" /* 8039 */ - "constantReflection\0" /* 8053 */ - "PHPStan\\Reflection\\ClassConstantReflection\0" /* 8072 */ - "canAccessConstant\0" /* 8115 */ - "classMemberReflection\0" /* 8133 */ - "PHPStan\\Reflection\\ClassMemberReflection\0" /* 8155 */ - "canAccessClassMember\0" /* 8196 */ - "debug\0" /* 8217 */ - "typeWithMethod\0" /* 8223 */ - "methodName\0" /* 8238 */ - "filterTypeWithMethod\0" /* 8249 */ - "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 8270 */ - "getMethodReflection\0" /* 8314 */ - "getNakedMethod\0" /* 8334 */ - "typeWithProperty\0" /* 8349 */ - "getPropertyReflection\0" /* 8366 */ - "getInstancePropertyReflection\0" /* 8388 */ - "getStaticPropertyReflection\0" /* 8418 */ - "typeWithConstant\0" /* 8446 */ - "constantName\0" /* 8463 */ - "getConstantReflection\0" /* 8476 */ - "constantType\0" /* 8498 */ - "getConstantExplicitTypeFromConfig\0" /* 8511 */ - "getConstantTypes\0" /* 8545 */ - "getGlobalConstantType\0" /* 8562 */ - "nameString\0" /* 8584 */ - "createGlobalConstantFetches\0" /* 8595 */ - "getNativeConstantTypes\0" /* 8623 */ - "getIterableKeyType\0" /* 8646 */ - "getIterableValueType\0" /* 8665 */ - "PHPStan\\Php\\PhpVersions\0" /* 8686 */ - "getPhpVersion\0" /* 8710 */ - "resolvePhpVersion\0" /* 8724 */ - "getConfiguredPhpVersionRange\0" /* 8742 */ - "isOverallPhpVersionRange\0" /* 8771 */ - "PhpParser\\Node\0" /* 8796 */ - "invokeNodeCallback\0" /* 8811 */ - "collectorType\0" /* 8830 */ - "data\0" /* 8844 */ - "emitCollectedData\0" /* 8849 */ - "extensionClass\0" /* 8867 */ - "trackValueDependency\0" /* 8882 */ - "file\0" /* 8903 */ - "trackFileDependency\0" /* 8908 */ - "directory\0" /* 8928 */ - "pattern\0" /* 8938 */ - "'*'\0" /* 8946 */ - "trackDirectoryDependency\0" /* 8950 */ - "trackClassDependency"; /* 8975 */ + "generalizeConstantFloats\0" /* 7726 */ + "getArrayDepth\0" /* 7751 */ + "equals\0" /* 7765 */ + "otherConditionalExpressions\0" /* 7772 */ + "compareConditionalExpressions\0" /* 7800 */ + "compareVariableTypeHolders\0" /* 7830 */ + "propertyReflection\0" /* 7857 */ + "PHPStan\\Reflection\\PropertyReflection\0" /* 7876 */ + "canAccessProperty\0" /* 7914 */ + "PHPStan\\Reflection\\ExtendedPropertyReflection\0" /* 7932 */ + "canReadProperty\0" /* 7978 */ + "canWriteProperty\0" /* 7994 */ + "methodReflection\0" /* 8011 */ + "PHPStan\\Reflection\\MethodReflection\0" /* 8028 */ + "canCallMethod\0" /* 8064 */ + "constantReflection\0" /* 8078 */ + "PHPStan\\Reflection\\ClassConstantReflection\0" /* 8097 */ + "canAccessConstant\0" /* 8140 */ + "classMemberReflection\0" /* 8158 */ + "PHPStan\\Reflection\\ClassMemberReflection\0" /* 8180 */ + "canAccessClassMember\0" /* 8221 */ + "debug\0" /* 8242 */ + "typeWithMethod\0" /* 8248 */ + "methodName\0" /* 8263 */ + "filterTypeWithMethod\0" /* 8274 */ + "PHPStan\\Reflection\\ExtendedMethodReflection\0" /* 8295 */ + "getMethodReflection\0" /* 8339 */ + "getNakedMethod\0" /* 8359 */ + "typeWithProperty\0" /* 8374 */ + "getPropertyReflection\0" /* 8391 */ + "getInstancePropertyReflection\0" /* 8413 */ + "getStaticPropertyReflection\0" /* 8443 */ + "typeWithConstant\0" /* 8471 */ + "constantName\0" /* 8488 */ + "getConstantReflection\0" /* 8501 */ + "constantType\0" /* 8523 */ + "getConstantExplicitTypeFromConfig\0" /* 8536 */ + "getConstantTypes\0" /* 8570 */ + "getGlobalConstantType\0" /* 8587 */ + "nameString\0" /* 8609 */ + "createGlobalConstantFetches\0" /* 8620 */ + "getNativeConstantTypes\0" /* 8648 */ + "getIterableKeyType\0" /* 8671 */ + "getIterableValueType\0" /* 8690 */ + "PHPStan\\Php\\PhpVersions\0" /* 8711 */ + "getPhpVersion\0" /* 8735 */ + "resolvePhpVersion\0" /* 8749 */ + "getConfiguredPhpVersionRange\0" /* 8767 */ + "isOverallPhpVersionRange\0" /* 8796 */ + "PhpParser\\Node\0" /* 8821 */ + "invokeNodeCallback\0" /* 8836 */ + "collectorType\0" /* 8855 */ + "data\0" /* 8869 */ + "emitCollectedData\0" /* 8874 */ + "extensionClass\0" /* 8892 */ + "trackValueDependency\0" /* 8907 */ + "file\0" /* 8928 */ + "trackFileDependency\0" /* 8933 */ + "directory\0" /* 8953 */ + "pattern\0" /* 8963 */ + "'*'\0" /* 8971 */ + "trackDirectoryDependency\0" /* 8975 */ + "trackClassDependency"; /* 9000 */ inline constexpr reg::PackedArg args[] = { reg::packed(0, 0, 9), /* __construct $services */ reg::packed(40, 0, 53), /* __construct $scopeFactory */ @@ -966,58 +967,61 @@ inline constexpr reg::PackedArg args[] = { reg::packed(7703, 0, 1424), /* generalizeType $b */ reg::packed(7705, MAY_BE_LONG), /* generalizeType $depth */ reg::packed(738, 0, 1424), /* generalizeType return */ + reg::packed(7701, MAY_BE_ARRAY), /* generalizeConstantFloats $a */ + reg::packed(7703, MAY_BE_ARRAY), /* generalizeConstantFloats $b */ + reg::packed(738, 0, 1424), /* generalizeConstantFloats return */ reg::packed(3874, 0, 1424), /* getArrayDepth $type */ reg::packed(738, MAY_BE_LONG), /* getArrayDepth return */ reg::packed(6479, 0, 523), /* equals $otherScope */ reg::packed(738, MAY_BE_BOOL), /* equals return */ reg::packed(278, MAY_BE_ARRAY), /* compareConditionalExpressions $conditionalExpressions */ - reg::packed(7747, MAY_BE_ARRAY), /* compareConditionalExpressions $otherConditionalExpressions */ + reg::packed(7772, MAY_BE_ARRAY), /* compareConditionalExpressions $otherConditionalExpressions */ reg::packed(738, MAY_BE_BOOL), /* compareConditionalExpressions return */ reg::packed(7596, MAY_BE_ARRAY), /* compareVariableTypeHolders $variableTypeHolders */ reg::packed(7616, MAY_BE_ARRAY), /* compareVariableTypeHolders $otherVariableTypeHolders */ reg::packed(738, MAY_BE_BOOL), /* compareVariableTypeHolders return */ - reg::packed(7832, 0, 7851), /* canAccessProperty $propertyReflection */ + reg::packed(7857, 0, 7876), /* canAccessProperty $propertyReflection */ reg::packed(738, MAY_BE_BOOL), /* canAccessProperty return */ - reg::packed(7832, 0, 7907), /* canReadProperty $propertyReflection */ + reg::packed(7857, 0, 7932), /* canReadProperty $propertyReflection */ reg::packed(738, MAY_BE_BOOL), /* canReadProperty return */ - reg::packed(7832, 0, 7907), /* canWriteProperty $propertyReflection */ + reg::packed(7857, 0, 7932), /* canWriteProperty $propertyReflection */ reg::packed(738, MAY_BE_BOOL), /* canWriteProperty return */ - reg::packed(7986, 0, 8003), /* canCallMethod $methodReflection */ + reg::packed(8011, 0, 8028), /* canCallMethod $methodReflection */ reg::packed(738, MAY_BE_BOOL), /* canCallMethod return */ - reg::packed(8053, 0, 8072), /* canAccessConstant $constantReflection */ + reg::packed(8078, 0, 8097), /* canAccessConstant $constantReflection */ reg::packed(738, MAY_BE_BOOL), /* canAccessConstant return */ - reg::packed(8133, 0, 8155), /* canAccessClassMember $classMemberReflection */ + reg::packed(8158, 0, 8180), /* canAccessClassMember $classMemberReflection */ reg::packed(738, MAY_BE_BOOL), /* canAccessClassMember return */ reg::packed(738, MAY_BE_ARRAY), /* debug return */ - reg::packed(8223, 0, 1424), /* filterTypeWithMethod $typeWithMethod */ - reg::packed(8238, MAY_BE_STRING), /* filterTypeWithMethod $methodName */ + reg::packed(8248, 0, 1424), /* filterTypeWithMethod $typeWithMethod */ + reg::packed(8263, MAY_BE_STRING), /* filterTypeWithMethod $methodName */ reg::packed(738, MAY_BE_NULL, 1424), /* filterTypeWithMethod return */ - reg::packed(8223, 0, 1424), /* getMethodReflection $typeWithMethod */ - reg::packed(8238, MAY_BE_STRING), /* getMethodReflection $methodName */ - reg::packed(738, MAY_BE_NULL, 8270), /* getMethodReflection return */ - reg::packed(8223, 0, 1424), /* getNakedMethod $typeWithMethod */ - reg::packed(8238, MAY_BE_STRING), /* getNakedMethod $methodName */ - reg::packed(738, MAY_BE_NULL, 8270), /* getNakedMethod return */ - reg::packed(8349, 0, 1424), /* getPropertyReflection $typeWithProperty */ + reg::packed(8248, 0, 1424), /* getMethodReflection $typeWithMethod */ + reg::packed(8263, MAY_BE_STRING), /* getMethodReflection $methodName */ + reg::packed(738, MAY_BE_NULL, 8295), /* getMethodReflection return */ + reg::packed(8248, 0, 1424), /* getNakedMethod $typeWithMethod */ + reg::packed(8263, MAY_BE_STRING), /* getNakedMethod $methodName */ + reg::packed(738, MAY_BE_NULL, 8295), /* getNakedMethod return */ + reg::packed(8374, 0, 1424), /* getPropertyReflection $typeWithProperty */ reg::packed(3728, MAY_BE_STRING), /* getPropertyReflection $propertyName */ - reg::packed(738, MAY_BE_NULL, 7907), /* getPropertyReflection return */ - reg::packed(8349, 0, 1424), /* getInstancePropertyReflection $typeWithProperty */ + reg::packed(738, MAY_BE_NULL, 7932), /* getPropertyReflection return */ + reg::packed(8374, 0, 1424), /* getInstancePropertyReflection $typeWithProperty */ reg::packed(3728, MAY_BE_STRING), /* getInstancePropertyReflection $propertyName */ - reg::packed(738, MAY_BE_NULL, 7907), /* getInstancePropertyReflection return */ - reg::packed(8349, 0, 1424), /* getStaticPropertyReflection $typeWithProperty */ + reg::packed(738, MAY_BE_NULL, 7932), /* getInstancePropertyReflection return */ + reg::packed(8374, 0, 1424), /* getStaticPropertyReflection $typeWithProperty */ reg::packed(3728, MAY_BE_STRING), /* getStaticPropertyReflection $propertyName */ - reg::packed(738, MAY_BE_NULL, 7907), /* getStaticPropertyReflection return */ - reg::packed(8446, 0, 1424), /* getConstantReflection $typeWithConstant */ - reg::packed(8463, MAY_BE_STRING), /* getConstantReflection $constantName */ - reg::packed(738, MAY_BE_NULL, 8072), /* getConstantReflection return */ - reg::packed(8463, MAY_BE_STRING), /* getConstantExplicitTypeFromConfig $constantName */ - reg::packed(8498, 0, 1424), /* getConstantExplicitTypeFromConfig $constantType */ + reg::packed(738, MAY_BE_NULL, 7932), /* getStaticPropertyReflection return */ + reg::packed(8471, 0, 1424), /* getConstantReflection $typeWithConstant */ + reg::packed(8488, MAY_BE_STRING), /* getConstantReflection $constantName */ + reg::packed(738, MAY_BE_NULL, 8097), /* getConstantReflection return */ + reg::packed(8488, MAY_BE_STRING), /* getConstantExplicitTypeFromConfig $constantName */ + reg::packed(8523, 0, 1424), /* getConstantExplicitTypeFromConfig $constantType */ reg::packed(738, 0, 1424), /* getConstantExplicitTypeFromConfig return */ reg::packed(738, MAY_BE_ARRAY), /* getConstantTypes return */ reg::packed(1520, 0, 1525), /* getGlobalConstantType $name */ reg::packed(738, MAY_BE_NULL, 1424), /* getGlobalConstantType return */ reg::packed(1520, 0, 1525), /* createGlobalConstantFetches $name */ - reg::packed(8584, MAY_BE_STRING), /* createGlobalConstantFetches $nameString */ + reg::packed(8609, MAY_BE_STRING), /* createGlobalConstantFetches $nameString */ reg::packed(227, MAY_BE_NULL | MAY_BE_STRING), /* createGlobalConstantFetches $namespace */ reg::packed(738, MAY_BE_ARRAY), /* createGlobalConstantFetches return */ reg::packed(738, MAY_BE_ARRAY), /* getNativeConstantTypes return */ @@ -1025,23 +1029,23 @@ inline constexpr reg::PackedArg args[] = { reg::packed(738, 0, 1424), /* getIterableKeyType return */ reg::packed(5138, 0, 1424), /* getIterableValueType $iteratee */ reg::packed(738, 0, 1424), /* getIterableValueType return */ - reg::packed(738, 0, 8686), /* getPhpVersion return */ - reg::packed(738, 0, 8686), /* resolvePhpVersion return */ + reg::packed(738, 0, 8711), /* getPhpVersion return */ + reg::packed(738, 0, 8711), /* resolvePhpVersion return */ reg::packed(738, MAY_BE_NULL, 1424), /* getConfiguredPhpVersionRange return */ reg::packed(3874, 0, 1424), /* isOverallPhpVersionRange $type */ reg::packed(738, MAY_BE_BOOL), /* isOverallPhpVersionRange return */ - reg::packed(1707, 0, 8796), /* invokeNodeCallback $node */ + reg::packed(1707, 0, 8821), /* invokeNodeCallback $node */ reg::packed(738, MAY_BE_VOID), /* invokeNodeCallback return */ - reg::packed(8830, MAY_BE_STRING), /* emitCollectedData $collectorType */ - reg::packed(8844, MAY_BE_ANY), /* emitCollectedData $data */ + reg::packed(8855, MAY_BE_STRING), /* emitCollectedData $collectorType */ + reg::packed(8869, MAY_BE_ANY), /* emitCollectedData $data */ reg::packed(738, MAY_BE_VOID), /* emitCollectedData return */ - reg::packed(8867, MAY_BE_STRING), /* trackValueDependency $extensionClass */ + reg::packed(8892, MAY_BE_STRING), /* trackValueDependency $extensionClass */ reg::packed(2540, MAY_BE_STRING), /* trackValueDependency $key */ reg::packed(738, MAY_BE_VOID), /* trackValueDependency return */ - reg::packed(8903, MAY_BE_STRING), /* trackFileDependency $file */ + reg::packed(8928, MAY_BE_STRING), /* trackFileDependency $file */ reg::packed(738, MAY_BE_VOID), /* trackFileDependency return */ - reg::packed(8928, MAY_BE_STRING), /* trackDirectoryDependency $directory */ - reg::packed(8938, MAY_BE_STRING, reg::NoString, false, false, 8946), /* trackDirectoryDependency $pattern */ + reg::packed(8953, MAY_BE_STRING), /* trackDirectoryDependency $directory */ + reg::packed(8963, MAY_BE_STRING, reg::NoString, false, false, 8971), /* trackDirectoryDependency $pattern */ reg::packed(738, MAY_BE_VOID), /* trackDirectoryDependency return */ reg::packed(2977, MAY_BE_STRING), /* trackClassDependency $className */ reg::packed(738, MAY_BE_VOID), /* trackClassDependency return */ @@ -1219,41 +1223,42 @@ inline constexpr sigtab::Sig generalizeWithVariableState = { { 7568 /* generaliz inline constexpr sigtab::Sig generalizeVariableTypeHolders = { { 7641 /* generalizeVariableTypeHolders */, 3, 449, 3, 452, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig flattenUnionForGeneralization = { { 7671 /* flattenUnionForGeneralization */, 1, 453, 1, 454, ZEND_ACC_PRIVATE } }; inline constexpr sigtab::Sig generalizeType = { { 7711 /* generalizeType */, 3, 455, 3, 458, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getArrayDepth = { { 7726 /* getArrayDepth */, 1, 459, 1, 460, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig equals = { { 7740 /* equals */, 1, 461, 1, 462, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig compareConditionalExpressions = { { 7775 /* compareConditionalExpressions */, 2, 463, 2, 465, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig compareVariableTypeHolders = { { 7805 /* compareVariableTypeHolders */, 2, 466, 2, 468, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig canAccessProperty = { { 7889 /* canAccessProperty */, 1, 469, 1, 470, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canReadProperty = { { 7953 /* canReadProperty */, 1, 471, 1, 472, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canWriteProperty = { { 7969 /* canWriteProperty */, 1, 473, 1, 474, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canCallMethod = { { 8039 /* canCallMethod */, 1, 475, 1, 476, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canAccessConstant = { { 8115 /* canAccessConstant */, 1, 477, 1, 478, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig canAccessClassMember = { { 8196 /* canAccessClassMember */, 1, 479, 1, 480, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig debug = { { 8217 /* debug */, 0, 481, 0, 481, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig filterTypeWithMethod = { { 8249 /* filterTypeWithMethod */, 2, 482, 2, 484, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getMethodReflection = { { 8314 /* getMethodReflection */, 2, 485, 2, 487, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getNakedMethod = { { 8334 /* getNakedMethod */, 2, 488, 2, 490, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPropertyReflection = { { 8366 /* getPropertyReflection */, 2, 491, 2, 493, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getInstancePropertyReflection = { { 8388 /* getInstancePropertyReflection */, 2, 494, 2, 496, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getStaticPropertyReflection = { { 8418 /* getStaticPropertyReflection */, 2, 497, 2, 499, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantReflection = { { 8476 /* getConstantReflection */, 2, 500, 2, 502, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantExplicitTypeFromConfig = { { 8511 /* getConstantExplicitTypeFromConfig */, 2, 503, 2, 505, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getConstantTypes = { { 8545 /* getConstantTypes */, 0, 506, 0, 506, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getGlobalConstantType = { { 8562 /* getGlobalConstantType */, 1, 507, 1, 508, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig createGlobalConstantFetches = { { 8595 /* createGlobalConstantFetches */, 3, 509, 3, 512, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; -inline constexpr sigtab::Sig getNativeConstantTypes = { { 8623 /* getNativeConstantTypes */, 0, 513, 0, 513, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getIterableKeyType = { { 8646 /* getIterableKeyType */, 1, 514, 1, 515, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getIterableValueType = { { 8665 /* getIterableValueType */, 1, 516, 1, 517, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig getPhpVersion = { { 8710 /* getPhpVersion */, 0, 518, 0, 518, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig resolvePhpVersion = { { 8724 /* resolvePhpVersion */, 0, 519, 0, 519, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig getConfiguredPhpVersionRange = { { 8742 /* getConfiguredPhpVersionRange */, 0, 520, 0, 520, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig isOverallPhpVersionRange = { { 8771 /* isOverallPhpVersionRange */, 1, 521, 1, 522, ZEND_ACC_PRIVATE } }; -inline constexpr sigtab::Sig invokeNodeCallback = { { 8811 /* invokeNodeCallback */, 1, 523, 1, 524, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig emitCollectedData = { { 8849 /* emitCollectedData */, 2, 525, 2, 527, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackValueDependency = { { 8882 /* trackValueDependency */, 2, 528, 2, 530, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackFileDependency = { { 8908 /* trackFileDependency */, 1, 531, 1, 532, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackDirectoryDependency = { { 8950 /* trackDirectoryDependency */, 1, 533, 2, 535, ZEND_ACC_PUBLIC } }; -inline constexpr sigtab::Sig trackClassDependency = { { 8975 /* trackClassDependency */, 1, 536, 1, 537, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig generalizeConstantFloats = { { 7726 /* generalizeConstantFloats */, 2, 459, 2, 461, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getArrayDepth = { { 7751 /* getArrayDepth */, 1, 462, 1, 463, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig equals = { { 7765 /* equals */, 1, 464, 1, 465, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig compareConditionalExpressions = { { 7800 /* compareConditionalExpressions */, 2, 466, 2, 468, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig compareVariableTypeHolders = { { 7830 /* compareVariableTypeHolders */, 2, 469, 2, 471, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig canAccessProperty = { { 7914 /* canAccessProperty */, 1, 472, 1, 473, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canReadProperty = { { 7978 /* canReadProperty */, 1, 474, 1, 475, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canWriteProperty = { { 7994 /* canWriteProperty */, 1, 476, 1, 477, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canCallMethod = { { 8064 /* canCallMethod */, 1, 478, 1, 479, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canAccessConstant = { { 8140 /* canAccessConstant */, 1, 480, 1, 481, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig canAccessClassMember = { { 8221 /* canAccessClassMember */, 1, 482, 1, 483, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig debug = { { 8242 /* debug */, 0, 484, 0, 484, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig filterTypeWithMethod = { { 8274 /* filterTypeWithMethod */, 2, 485, 2, 487, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getMethodReflection = { { 8339 /* getMethodReflection */, 2, 488, 2, 490, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getNakedMethod = { { 8359 /* getNakedMethod */, 2, 491, 2, 493, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPropertyReflection = { { 8391 /* getPropertyReflection */, 2, 494, 2, 496, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getInstancePropertyReflection = { { 8413 /* getInstancePropertyReflection */, 2, 497, 2, 499, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getStaticPropertyReflection = { { 8443 /* getStaticPropertyReflection */, 2, 500, 2, 502, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantReflection = { { 8501 /* getConstantReflection */, 2, 503, 2, 505, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantExplicitTypeFromConfig = { { 8536 /* getConstantExplicitTypeFromConfig */, 2, 506, 2, 508, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getConstantTypes = { { 8570 /* getConstantTypes */, 0, 509, 0, 509, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getGlobalConstantType = { { 8587 /* getGlobalConstantType */, 1, 510, 1, 511, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig createGlobalConstantFetches = { { 8620 /* createGlobalConstantFetches */, 3, 512, 3, 515, ZEND_ACC_PRIVATE | ZEND_ACC_STATIC } }; +inline constexpr sigtab::Sig getNativeConstantTypes = { { 8648 /* getNativeConstantTypes */, 0, 516, 0, 516, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getIterableKeyType = { { 8671 /* getIterableKeyType */, 1, 517, 1, 518, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getIterableValueType = { { 8690 /* getIterableValueType */, 1, 519, 1, 520, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig getPhpVersion = { { 8735 /* getPhpVersion */, 0, 521, 0, 521, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig resolvePhpVersion = { { 8749 /* resolvePhpVersion */, 0, 522, 0, 522, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig getConfiguredPhpVersionRange = { { 8767 /* getConfiguredPhpVersionRange */, 0, 523, 0, 523, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig isOverallPhpVersionRange = { { 8796 /* isOverallPhpVersionRange */, 1, 524, 1, 525, ZEND_ACC_PRIVATE } }; +inline constexpr sigtab::Sig invokeNodeCallback = { { 8836 /* invokeNodeCallback */, 1, 526, 1, 527, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig emitCollectedData = { { 8874 /* emitCollectedData */, 2, 528, 2, 530, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackValueDependency = { { 8907 /* trackValueDependency */, 2, 531, 2, 533, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackFileDependency = { { 8933 /* trackFileDependency */, 1, 534, 1, 535, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackDirectoryDependency = { { 8975 /* trackDirectoryDependency */, 1, 536, 2, 538, ZEND_ACC_PUBLIC } }; +inline constexpr sigtab::Sig trackClassDependency = { { 9000 /* trackClassDependency */, 1, 539, 1, 540, ZEND_ACC_PUBLIC } }; } // namespace sig } // namespace ptdecl::MutatingScope