- Add explicit response file path support to compiler backends
- Implement TYPEPHP_COMPILER_EXECUTABLE constant for compiler fingerprinting
- Add exception handling for native source project compilation
- Create dedicated extension header inclusion logic to reduce build invalidations
- Implement small task lane reservation in parallel compilation
- Add DOM extension requirement check for native project support
- Optimize symbol collection with single depth-first AST walk
- Add request array default metadata finalization
- Implement content-based rather than timestamp-based object caching
- Add link cache metadata file management
- Update incremental compilation to preserve timestamps for identical content
- Add comprehensive test coverage for response file and caching features
- Replace sequential indexing with stable ID allocation for persistent entities
- Add StableIdRegistry to maintain consistent IDs across builds
- Implement incremental compilation with dependency tracking
- Add IncrementalBuildState for tracking file dependencies and dirty propagation
- Update anonymous class generation to use stable call site IDs
- Modify type ID allocation to start from 1 and avoid renumbering
- Add literal string ID allocation using stable registry
- Implement global variable usage recording and tracking
- Add dependency symbols for classes, functions, constants, and globals
- Update property and function index allocation to use stable IDs
- Add cache site ID allocation based on call site context
- Implement compilation statistics merging and delta calculation
- Add file writing with content comparison to avoid unnecessary writes
- Implement incremental build cache clearing functionality
- Add metadata restoration for incremental compilation
- Create dependency graph building and dirty file propagation logic
- Implement translation unit emission tracking for incremental builds
- Updated swoole/phpx from ~2.8.1 to ~2.8.2
- Removed ext-dom requirement from composer.json
- Maintained ajaxray/ansikit at ^0.3 version
- Kept other dependency versions unchanged
- Implemented AstCache class with schema versioning and file-based storage
- Added cache validation using source hash, PHP version, and parser version
- Integrated atomic file operations to ensure cache consistency
- Updated CompilerBase to use lazy-initialized AST cache instance
- Replaced direct parser calls with cache-aware load operations in preprocessor
- Modified translator to utilize cached AST instead of reparsing
- Added comprehensive test coverage including cache hit, invalid
- Fixed private method accessibility check to properly return empty string
when method is private and inaccessible
- Updated property signature resolution to preserve method metadata for
nullable object properties
- Modified final class check to require non-nullability for typed property
receiver optimization
- Added test case for nullable typed property preserving by-reference
arguments when non-null
- Added test case for typed property following runtime protected override
or __call target
- Add reflection to access compiler's persistentFuncMap and literalStrings properties
- Retrieve actual function ID and string ID for 'get_class' at runtime
- Replace hardcoded regex values with dynamic IDs from compiler state
- Ensure polymorphic get_class dispatch uses correct persistent function lookup
- Maintain existing assertion logic while making test more robust to compiler changes
- Removed pcntl dependency and related functions from PlatformBase and Windows classes
- Implemented proc_open-based process pool in NativeBuilder for cross-platform parallel compilation
- Updated dispatchParallel to dispatchProcessParallel with new process management logic
- Modified Translator to use process pool instead of pcntl for parallel compilation
- Added fallback to sequential compilation when proc_open is unavailable
- Updated ParallelCompileTest to use process-based tests instead of pcntl mocking
- Bumped version from 0.8.1 to 0.8.2 in project configuration files
* fix(compiler): preserve runtime class dispatch and introspection for polymorphic objects
When an object variable has an upper-bound declared type (e.g. assigned from
a function or method return), SSA marks it as a stable object. However,
stableObjects does not guarantee the concrete runtime class: the instance
may be a subclass at runtime, or null if nullable.
1. FuncCallOptimizer::genGetClassOptimized checked isStableObject($obj->name)
and folded get_class($obj) to the declared type literal string. For
$a = getAnimal() returning a Dog, get_class($a) was incorrectly folded
to "Animal" at compile time.
2. MethodCallTrait::parseStaticCall checked isStableObject($class) and
jumped to _do_call with the declared base class. For $a::who(), this
statically invoked Base::who() instead of dispatching to Dog::who() on
the runtime object.
Require proven exact object instances (exactObjects, populated from direct
new ConcreteClass() definitions) before folding get_class() or devirtualizing
static calls on object variables. Non-exact variables fall back to runtime
class resolution (php::fn::get_class() and php::callStaticMethod()),
matching PHP semantics.
Add unit test coverage verifying exact objects continue to fold/devirtualize
while polymorphic variables retain dynamic runtime dispatch.
* fix(compiler): preserve lexical scope in dynamic static calls and runtime type checks for get_class
- Use php::callScoped with getCallableScopeExpr() for dynamic static calls inside class methods to preserve caller visibility on protected methods
- Fall back to runtime php::call for get_class on non-exact values so nullable objects throw TypeError instead of dereferencing null
- Add behavioral PHPT tests for protected polymorphic static calls and nullable get_class
- Update unit tests for scoped dispatch and runtime introspection
* test(compiler): remove stray top-level main call from PHPT tests
In TypePHP AOT compilation, function main(): void serves as the binary
entrypoint. Top-level function calls outside a function are rejected by
the preprocessor as stray code.
* fix(compiler): resolve function imports before dispatch and policy checks
* test: close PHP section in function import PHPT
* fix(compiler): resolve first-class function aliases
* fix(compiler): preserve called class in direct method calls
* fix(compiler): resolve called-class function targets
* fix(compiler): retain optimized namespace builtins
- Add materializeTrailingDefaults parameter to CallArgumentGenerator for default argument handling
- Implement native object stack slot allocation and promotion analysis
- Add nativeStackPromotions context tracking for non-escaping object allocations
- Generate NativeStackSlot declarations in compiler base code generation
- Update native method call generation to use direct member access patterns
- Add comprehensive native object member name validation and conflict detection
- Implement native destructor state management and finalization chains
- Add test cases for native class member name conflicts and stack promotion scenarios
- Replace nativeDeref calls with nativeRequireObject for improved object access safety
- Introduce CompilationStatistics class to track function, class, type, and dynamic capability usage
- Add statistics collection to CompilerBase for functions, classes, and types during conversion
- Implement NanoExtensionSelector to convert statistics into selective extension component needs
- Add fine-grained feature selection for standard extension components like arrays, strings, filesystem
- Create ComposerNativeComponent class for selective composition of native package parts
- Extend ComposerNativePackage with component metadata parsing and validation
- Update NanoSourceComposer to use statistics-driven selective composition
- Add test coverage for compilation statistics and extension selection scenarios
- Include example code and comprehensive test suite for new
- Replace syscall-based time functions with CLOCK_MONOTONIC using clock_gettime
- Add 100 Hz PIT timer and COM1 serial input interrupt handling via 8259 PIC
- Implement nanosleep syscall with proper duration calculation and interruptible sleep
- Add blocking console reads that wait for IRQ4 input instead of busy polling
- Update clock resolution to 10 ms (100 Hz) for monotonic clock
- Add proper timer tick tracking and interrupt dispatch mechanism
- Enable hardware interrupts in user mode while maintaining syscall protection
- Add sleep function wrapper around nanosleep in
- Add typephp_os_disk_cache_bytes function to return ATA cache size
- Implement C++ terminate function with typephp_os_panic call
- Create new free.cc with php_os_memory_value native function
- Add free.php memory reporting command with pool accounting
- Define free.yml build configuration for the new command
- Update hello.yml with additional compiler flags
- Add syscall declaration to ioctl.c
- Introduce arena_begin variable and typephp_os_memory_total function
- Implement vfprintf function using vprintf
- Add typephp_os_longjmp implementation with proper asm annotation
- Update fprintf to use v
- Increased ATA cache capacity from 16384 to 65536 sectors for 32 MiB direct-mapped cache
- Expanded bootstrap stack from 16 KiB to 256 KiB with proper headroom for identity-map tables
- Updated userspace syscall interface from int 0x80 to native x86-64 SYSCALL instruction
- Raised QEMU memory allocation from 160M to 512M for improved runtime performance
- Increased kernel reserved memory from 40 MiB to 64 MiB with updated linker script assertion
- Added fixed-console ioctl(TIOCGWINSZ) support for VGA dimension reporting
- Enhanced ATA
- Replace int 0x80 with native x86-64 SYSCALL instruction for faster system calls
- Add syscall number 16 for ioctl support with Linux-compatible ABI
- Implement TIOCGWINSZ and TIOCNOTTY terminal ioctls for console size detection
- Add ENOTTY error code definition for inappropriate ioctl operations
- Increase ATA cache capacity from 128 to 16384 entries for better performance
- Change ATA cache from LRU eviction to direct mapping using bitwise AND
- Remove least recently used tracking from ATA cache entries
-
- Move user command sources from user/ to user/cmd/ directory
- Update Makefile to reference user/cmd/ path for compiling .c files
- Restructure user/ directory to separate commands from runtime components
- Add documentation about cmd/ and runtime/ organization in user/README.md
- Update main README.md to reflect new user space structure
- Maintain existing
- Replace global errno variable with __errno_location function
- Add complete strerror implementation for standard error codes
- Implement perror function for error message output
- Move strlen implementation to separate string.c file
- Update getcwd to use new errno macro instead of direct variable
- Mark getcwd as weak symbol to allow overriding
- Remove unimplemented strerror stub from assembly file
- Add 128-bit integer helpers from compiler-rt builtins
- Update third-party dependencies with detailed documentation
- Improve curl download scripts with silent
- Implemented opendir, readdir, closedir, and related directory functions
- Added fcntl system call support with proper flag handling
- Integrated compiler-rt builtins for 128-bit integer operations
- Updated build system to fetch and compile compiler-rt dependencies
- Refactored ls command to use standard POSIX directory APIs
- Added directory file descriptor management in kernel
- Implemented getdents64
- Added Linux-compatible file metadata syscalls (stat, lstat, fstat, newfstatat)
- Implemented access control checks with faccessat and related flag definitions
- Added file persistence operations (fsync, fdatasync, truncate, ftruncate)
- Integrated clock syscalls (gettimeofday, clock_gettime, clock_getres)
- Added process identity queries (getpid, getppid, gettid, getuid, getgid)
- Changed exit mechanism from exit(60) to exit_group(231) for consistency
- Updated crt0.S with Linux x86-64 exit_group ABI compatibility
- Extended fcntl.h with AT_SYMLINK_NOFOLLOW and AT_EACCESS constants
- Added complete syscalls implementation in user/libc.c and runtime/posix.c
- Implemented kernel-side syscall handlers in process.c with proper validation
- Added systest utility to verify file metadata, persistence and identity calls
- Updated Makefile dependencies to track user header changes
- Enhanced README documentation for new
- Configure kernel-only paging with separate user virtual regions
- Add PHP Nano project compilation with link library support
- Implement aligned memory block management for Zend allocator
- Create reusable libtypephp-os.a platform archive for TypePHP userspace
- Add uname system call support and update user-space syscalls
- Increase QEMU memory allocation from 128M to 160M
- Add TNHELLO.ELF as full TypePHP + PHPX
- Remove nm command execution for checking undefined symbols during build
- Add explanatory comment about native objects providing OS ABI to each other
- Update translator to only check undefined symbols in final ELF target
- Clarify that only unresolved imports in final executable cross host boundary
- Maintain auditor checks while removing intermediate object file validation
- Add crt0.S assembly startup code for user mode entry point
- Create hello.php example application with basic system information output
- Add hello.yml build configuration for nano user mode executable
- Implement host.cc with system call interfaces and runtime initialization
- Add linker script for proper user mode memory layout
- Update Makefile with new user base addresses for shell and commands
- Implement posix.c with POSIX compatibility layer using system calls
- Update process.c with new user memory range constants and stack sizes
- Add syscall.S assembly wrapper for Linux system call interface
- Modify vm.c with expanded user address space mapping and cleanup
- Update vmfault.c with correct shell memory address reference
- Add ATA disk cache with LRU eviction strategy and hit/miss statistics
- Introduce disk cache metrics accessible through kernel API
- Update boot sequence to enable long mode and execute-disable page permissions
- Replace custom syscalls with standard POSIX equivalents in user programs
- Add new user utilities including cat, echo and fault testing command
- Enhance FAT16 volume implementation with full path traversal and file operations
- Implement comprehensive filesystem layer supporting nested directories
- Add file operations for reading, writing, creating and deleting files/directories
- Include directory listing and
- Add date command implementation that displays current time in UTC format
- Add pwd command to print current working directory
- Update Makefile to build date and pwd as user programs with shared ELF loading
- Refactor syscall handling to use shared header definitions
- Remove KernelGreeting class from kernel startup sequence
- Update README and ROADMAP documentation for new user commands
- Add test assertions for date and pwd command output in test suite
- Introduce reusable command address space management in process.c
- Add user-accessible page mapping (32-36 MiB) in boot.S with proper permission bits
- Implement ELF64 loader and process management in new process.c module
- Add syscall infrastructure including int 0x80 handler in process-entry.S
- Create userspace programs (sh, ls, cd) with dedicated linker script
- Integrate filesystem path type checking and directory listing functions
- Reserve memory regions for user processes and update kernel memory layout
- Add console input/output support for userspace applications
- Update kernel main loop to start user process after initialization
- Modify Makefile to build and embed userspace ELF images as kernel objects
- Document new userspace capabilities and limitations in README.md
- Implemented low-level ATA PIO driver with read/write/flush operations
- Added FAT16 filesystem layer with directory and file management
- Created bridge between C disk operations and PHP filesystem API
- Integrated disk availability detection and LBA sector access
- Implemented file operations including open, read, write, and close
- Added support for directory creation, file listing and renaming
- Included proper error handling and disk initialization logic
- Include 'std/fs.h' in the list of standard library headers
- Enable filesystem operations support in the translator
- Add file system utility functions access for users
- 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