- Add objects section to project.yml for linking precompiled .o/.obj files
- Implement getProjectObjectFiles method to retrieve precompiled objects
- Add c-flags and asm-flags support in CompilerBase
- Extend GCC backend to handle cflags and nativeflags configuration
- Update compiler to include project object files in linking process
- Add freestanding C++ allocation ABI implementation using Zend MM
- Include example TypePHP OS with kernel entry point and hardware stubs
- Add assembly files for boot sequence and kernel entry point
- Implement basic libc compatibility layer for Zend bootstrap
- Add try/catch macro replacement in generated code indentation
- Create bridge between C++ kernel and PHP code
- Add linker script for 64-bit kernel binary generation
- Updated swoole/phpx from ~2.8.0 to ~2.8.1
- Moved swoole/php-nano from require to require-dev with version ^1.0.0
- Updated project version from 0.8.0 to 0.8.1 in project.yml
- Updated file and product versions in project.yml to 0.8.1
- Updated VERSION constant in Translator.php to 0.8.1
- Add native source project compilation workflow with project.xml configuration
- Implement closure reference capture analysis and type degradation for native objects
- Add WASI and nano mode function support checks with comprehensive API exclusions
- Introduce Composer native package discovery and validation system
- Add build scripts for WASI nano program compilation with browser module support
- Implement closure generator enhancements for reference capture handling
- Add CLI usage tests and compiler base API validations
- Integrate php-nano runtime dependencies and native package management
- Add type degradation analysis for closure use variables in generators and functions
- Renamed std::ordered_map to std::orderedMap following camelCase naming convention
- Added new std::object() function to restore concrete object type information
- Updated all test files to use the new orderedMap naming
- Modified parser to recognize orderedmap in assign operations
- Updated documentation to reflect the new naming and function
- Added polyfill implementation for std::object()
- Updated README and changelog with
* fix(compiler): support first-class callable of internal functions
PHP 8.1 `foo(...)` builds a Closure from a single VariadicPlaceholder
argument instead of calling foo. Two paths mishandled it:
- checkInternalFunctionArgCount() counted the placeholder as a real
argument, so first-class callables of internal functions requiring 2+
parameters (e.g. `posix_kill(...)`) failed with a bogus "expects at
least N arguments, 1 given".
- The math-function return-type optimization read `$expr->args[0]->value`
on callables such as `round(...)`, crashing on the undefined
VariadicPlaceholder::$value property.
Guard both with isFirstClassCallable() so the expression falls through to
Closure (Type::OBJECT) resolution.
* fix(compiler): infer builtin callables before return optimizations
---------
Co-authored-by: Tinywan <tinywan@gmail.com>
- Removed redundant zval macro handling for property access
- Replaced Z_LVAL_P and Z_DVAL_P calls with direct attribute accessors
- Updated property getter logic to use attrInt and attrFloat methods
- Modified tests to match new property access pattern
- Added comprehensive test case for inherited property reference handling
- Allow int, float, bool, string, and array Native Class properties to be passed
directly to matching reference parameters on statically resolved calls
- Generate call-scoped C++ T& bindings for typed reference parameters instead
of creating Zend references
- Maintain compile-time rooting of Native receiver objects during typed calls
- Add new parseNativeTypedPropertyReferenceArg method to handle typed property
reference arguments
- Update documentation to reflect new typed reference capabilities for fixed
Native properties
- Create new test case covering typed property reference functionality
- Modify changelog to document the
- Add mobile native development capabilities to cross-platform features
- Include Android NDK and iOS SDK support in platform targets
- Update backend support to mention Android arm64-v8a and iPhoneOS arm64
- Add information about mobile app UI bridge architecture
- Include links to Android native app example and iOS/macOS native app example
- Clarify mobile development workflow with TypePHP for business logic
- Create Android project structure with build configuration and manifest
- Implement PHP-to-Java bridge with JNI integration for native Android UI components
- Add comprehensive UI stub functions including window creation, labels, buttons, and inputs
- Develop Android Activity with native View bridge and layout management system
- Integrate build scripts for compiling PHP into Android shared library and packaging APK
- Include installation script with ADB deployment and application launching
- Provide complete Hello World application demonstrating TypePHP Android capabilities
- Add proper Git ignore rules and documentation for the Android example
- Implement Android platform class with API level detection and compiler configuration
- Add Android-specific library linking with proper archive grouping and system libraries
- Integrate Android target detection and SDK directory resolution in build configuration
- Add Android-specific compile flags including static libstdc++ and security hardening
- Include Android platform support in translator and compiler base classes
- Add PHPX_ANDROID=1 define flag for Android builds
- Support
- Update swoole/phpx from ~2.7.0 to ~2.8.0 in composer.json
- Add proper button styling for macOS 11+ with automatic button styles
- Fix control nil check in macos_bridge.mm to prevent crashes
- Use title property for NSButton updates on macOS to handle system-style buttons
- Refactor unset handling in PropertyAccessTrait to use type-specific defaults
- Replace hardcoded default values with Type::getDefaultValueExpression calls
- Add
- Updated std::any to accept zero or one arguments instead of requiring exactly one
- When no argument is provided, std::any now returns null by default
- Modified parser logic to handle omitted parameter case in FunctionCallTrait
- Updated documentation in both English and Chinese to reflect optional parameter syntax
- Added test case demonstrating std::any() call without parameters returning null
- Changed error message to indicate zero or one argument requirement instead of exactly one
- Create native macOS GUI application using TypePHP and Objective-C++ bridge
- Implement thin wrappers around AppKit API for window management and controls
- Add support for labels, buttons, and event handling in native macOS interface
- Include proper Info.plist configuration and code signing script for app bundles
- Provide complete example with application lifecycle and user interaction
- Document build requirements and packaging instructions for macOS distribution
- Add five new reference types (INT_REF, STR_REF, FLOAT_REF, BOOL_REF, ARRAY_REF)
- Create typed reference ABI using C++ references for strict type safety
- Implement RefWrap<T> bridge for dynamic PHP reference compatibility
- Add getRawVarType() and update getVarType() to handle reference unwrapping
- Enforce strict typing rules preventing fixed storage corruption via references
- Support typed property and array element reference handling
- Implement exception-safe reference binding with proper
- Replace manual array key parsing with direct Node\Scalar\Int_ creation
- Route all destructuring assignments through parseAssignFinally for proper type handling
- Remove redundant left expression type detection in assignment operations
- Fix argument index mapping in CallArgumentGenerator to use source indices correctly
- Restore outer context before closure reference validation to prevent type conflicts
- Remove unused local variable promotion logic in foreach reference binding
- Add explicit error messages for native variable reference capture attempts
- Track foreach target variables in SSA optimizer for proper type analysis
- Use numeric indices instead of case labels in switch statement generation
- Add comprehensive tests for varint type handling in foreach loops
- Replace direct function calls with call() wrapper in ext.cc
- Remove unused php_func.h include
- Add new ctype/main.php example with isAsciiWhitespace function
- Implement proper parameter validation for ASCII range checking
- Add main function to demonstrate ctype space detection usage
- Replace any() with std::any() in test files and compiler logic
- Replace refval() with std::ref() for reference wrapping operations
- Replace expected() with std::expected() for branch prediction hints
- Replace unexpected() with std::unexpected() for branch prediction hints
- Remove deprecated objval() function and use toObject() keyword method
- Update parser to recognize std:: class expressions with case insensitivity
- Add comprehensive changelog documenting breaking API changes
- Update documentation to reflect new std:: namespace conventions
- Add tests for case-insensitive std class and method names
- Verify global function names remain available for user-defined functions
- Replace ArgList with VarList for fixed argument arrays to avoid dynamic Args allocation
- Add call argument limit assertion to prevent unbounded call generation
- Implement direct static method calls using callStaticMethod when possible
- Add alternating dynamic static call benchmarks for class and method variations
- Update documentation on request-local call slot destruction requirements
- Fix dynamic static call target evaluation order to precede argument evaluation
- Add tests for call argument limits and dynamic class evaluation ordering
- Add function call cache infrastructure with typephp_call_cached wrapper
- Implement method call caching using typephp_call_method_cached for named methods
- Add scoped method call caching via typephp_call_method_scoped_cached for dynamic scopes
- Create late-static-bound class entry tracking with getCalledCeExpr and getCalledClassExpr
- Implement lazy static property slot resolution with typephp_get_static_property_cached
- Add benchmark cases for dynamic static method calls and scoped method invocations
- Update call cache test expectations to reflect new cached call implementations
- Integrate call caching into function and method call compilation paths
- Add nullsafe method call caching support in nullsafe access trait
- Implement static property slot registration and resolution mechanisms
- Update native property handling to use cached static property access
- Add comprehensive test coverage for various dynamic call scenarios
- Implement exact-class fast path for zero-argument late-static calls with fallback mechanism
- Add static property fetch resolution using typephp_get_static_property symbol
- Enhance isset operations on static array properties with direct typephp_array_isset calls
- Update class reference detection to return Type::STR for class constant fetch expressions
- Add benchmark suite for static cache performance measurement including late static dispatch
- Modify compiler symbols to use typephp variants for called class and static property access
- Create comprehensive tests for static array single offset presence and late static call exact guards
- Update unit tests to reflect new symbol names and variable
- Add forceArrayArgs parameter to CallArgumentGenerator methods to properly handle
named arguments with setValue method instead of set
- Implement direct foreach array target optimization to improve iteration
performance by allowing direct assignment to variant variables
- Add comprehensive tests for dynamic call cache argument preservation
including small, large, named, unpacked, reference, and exception arguments
- Add tests for dynamic property access with string, referenced-string, and
converted names
- Add tests for foreach direct array targets preserving keys, values, references
- Update CI workflows to checkout PHPX from third_party directory instead of vendor
- Add smoke test for full static builds to verify module globals setup
- Enhance benchmark suite with additional dynamic call cases for different
argument counts (zero, two, four args) to separate cache lookup from argument
materialization costs
- Add case filtering option to property
- Updated swoole/phpx from ~2.6.13 to ~2.7.0 in composer.json
- Bumped version constraint to use latest stable release
- Maintains compatibility with existing extension requirements
* optimize: convert for-loop post-inc/dec to prefix to avoid zval copy
For-loop post-expressions (third clause of `for (init; cond; post)`) always
discard the return value, so $i++ is semantically identical to ++$i in this
context. Converting to prefix increment/decrement avoids the zval copy +
destructor overhead from operator++(int)'s return value, saving ~6ns per
increment per loop iteration.
Changes:
- LoopControlTrait: convert PostInc→PreInc, PostDec→PreDec in for-loop
post-expressions only (while/do-while body untouched)
- Add phpunit test verifying generated C++ contains ++i/--i for for-loops
and retains i++ in while/do-while bodies
- Add test data file with 7 test functions covering basic, multi-post,
nested, mixed, and while/do-while cases
* fix: restrict for-loop post-expr rewrite to simple variables only