Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 3.39 KB

CONTRIBUTING.md

File metadata and controls

73 lines (48 loc) · 3.39 KB

Contributing

Issues are tracked through Github Issues. Please check if there are similar issues via github search before filing an issue.

Pull requests are welcome, test cases covering bug fixes or new functionality are preferred.

If reporting a crash, please include a minimal file (or link to a project) that can reproduce the issue, as well as the output of php --version and php-config. (And php.ini settings)

Issues labelled with help wanted are probably good first issues.

Project layout

Headers are found in php_runkit*.h Source files are found in runkit*.c

config.m4 (Unix/Linux) and config.w32 (windows) are used to generate ./configure and the make file package.xml contains the configuration for generating a PECL package. It should be updated when new tests or source files are added.

Some code still hasn't been ported from config.m4 to config.w32.

Running tests

Tests can be found in tests/.

phpize
./configure
make clean test

PHP Extension development

For those unfamiliar with PHP5 extension writing:

The representation of internal values(zvals) has changed between PHP5 and PHP7, along with the way refcounting is done.

This now uses zend_string. I changed the code to use zend_string wherever possible to be consistent. This is not strictly necessary.

Notes on HashTables

  • https://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html
  • HashTables no longer use linked lists. They use an array of Buckets instead, and use collision chaining. (TODO: implement php_runkit_hash_move_to_front)
  • The new versions of zend_hash_* take zend_string pointers instead of pairs of `char*
  • Most zend_hash_* now have equivalent zend_hash_str_* methods. (If I remember correctly, zend_hash_str_* methods now taken strlen as the length instead of strlen+1)
  • To add/retrieve pointers from a zend_hash, there are now zend_hash_*_ptr methods. Depending on the table being used, these may call destructor functions when pointers are removed.

Changes to the internal representation of HashTables require a lot of code changes.

Miscellaneous notes on differences between PHP5 and PHP7