Skip to content

Latest commit

 

History

History

README.md

my_php_extension

A basic PHP extension demonstrating core phpz features:

  • Functions: hello_world(), whoami(), human()
  • Classes: MyPHPExt\Counter, MyPHPExt\Human
  • Error handling: type errors, value errors

Run

zig build test

This builds the extension and runs test.php against it.

Custom PHP include path:

zig build test -Dphp-include-root=/usr/include/php8.4

Manually

# 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