A basic PHP extension demonstrating core phpz features:
- Functions:
hello_world(),whoami(),human() - Classes:
MyPHPExt\Counter,MyPHPExt\Human - Error handling: type errors, value errors
zig build testThis builds the extension and runs test.php against it.
Custom PHP include path:
zig build test -Dphp-include-root=/usr/include/php8.4# Build
zig build
# Run test script
php -dextension=./modules/my_php_extension.so test.php
# Check extension info
php -dextension=./modules/my_php_extension.so --ri my_php_extension