- Add test case for foreach by value behavior when current element is removed
- Verify that foreach maintains stable array snapshot during iteration
- Confirm expected output matches array traversal before modifications
- Document behavior where unset operations don't affect ongoing loop
refactor(parser): simplify foreach array handling logic
- Remove dedicated parseForeachArray method from ForeachTrait
- Consolidate array iteration to use existing parseForeachIterable method
- Maintain same functional behavior while reducing code duplication
- Update type checking logic to route arrays
- Replace direct php::concat calls with flattened concatenation using parseFlattenedConcat
- Add prepareConcatOperand method to handle proper string conversion for different types
- Implement unified foreach iterator using php::ForeachIterator for both arrays and objects
- Remove separate parseForeachObject method and consolidate iteration logic
- Add support for precompiled headers in GCC-like backends
- Implement PrecompiledHeaderManager for PCH preparation and caching
- Optimize build queue with SourceCompileQueue using largest-first sorting strategy
- Improve progress percentage calculation during compilation
- Add new test case for unified foreach iteration over different iterable types
- Replaced all occurrences of self::TYPE_* with Type::* in AnonClassGenerator.php
- Updated ArrayExpressionTrait.php to use Type::ARRAY and Type::VAR instead of self::TYPE_*
- Modified AssignOpTrait.php to reference Type constants instead of self::TYPE_*
- Changed BinaryOpTrait.php to use Type::BIGINT, Type::DECIMAL, Type::BIGFLOAT constants
- Updated CallArgumentGenerator.php to use Type::ARRAY and Type::REF constants
- Added Type import statements to all modified files
- Maintained same functionality while improving code consistency with Type namespace
- Extract foreach parsing methods into new ForeachTrait
- Extract switch parsing methods into new SwitchTrait
- Add trait usage in CompilerBase to maintain existing functionality
- Remove duplicate method implementations from CompilerBase
- Preserve all original parsing behavior through trait integration
- Improve code organization by separating concerns into focused modules