phpsmith
creates random PHP and KPHP programs to test their compilers and runtimes.
It can create both valid (but very contrived) and invalid programs.
- Random valid php code generation
- Random invalid php code generation
- Reproducible program generation by seed
- Big generation variability
Phpsmith can be executed in two modes: fuzz
, generate
:
-
fuzz
:- infinitely generate php programs
- run it on php and kphp
- catch exceptions, segmentation faults, fatal errors
- compare results between php and kphp
- save diff in logs
-
generate
:- generate php program by provided seed
go install github.com/quasilyte/phpsmith
- php ≥7.0
- kphp ≥9.3.0
Run phpsmith
without arguments to get help output.
Possible commands are:
version print phpsmith version info to stdout and exit
fuzz run fuzzing using the provided configuration
generate generate a program using the provided configuration
fuzz
command examples:
phpsmith fuzz -o ~/phpsmith_out
generate
command examples:
phpsmith generate -seed 1651182107