your contribution 1 • Kentaro Takeda / @KentarouTakeda • 20 years of PHP experience • 2 years of C experience - but that was 30 years ago Honestly, I can't write C anymore • php-src contributor Again, I can't write C!
is waiting for your contribution 3 1. Running test suites in RC and release distributions of PHP 2. Help finding and diagnosing failed tests, see the phpt documentation 3. Filing and resolving bug reports on GitHub Issues. 4. Help maintain and or translate documentation files at the doc-* repositories on github. Check out our guide for contributors. https://www.php.net/get-involved
the test case •Used in the test runner’s output --TEST-- Test Fizz Buzz Function --FILE-- <?php var_dump(fizz_buzz(10)); var_dump(fizz_buzz(11)); var_dump(fizz_buzz(12)); var_dump(fizz_buzz(13)); var_dump(fizz_buzz(14)); var_dump(fizz_buzz(15)); --EXPECT-- string(4) "Buzz" int(11) string(4) "Fizz" int(13) int(14) string(8) "FizzBuzz"
•If the actual output is different, the test fails --TEST-- Test Fizz Buzz Function --FILE-- <?php var_dump(fizz_buzz(10)); var_dump(fizz_buzz(11)); var_dump(fizz_buzz(12)); var_dump(fizz_buzz(13)); var_dump(fizz_buzz(14)); var_dump(fizz_buzz(15)); --EXPECT-- string(4) "Buzz" int(11) string(4) "Fizz" int(13) int(14) string(8) "FizzBuzz"
is waiting for your contribution 9 • Run tests on the development version of PHP. • If you find a failing test, investigate and fix it. • Even if tests don't fail, improve the coverage, design, or implementation of tests.
waiting for your contribution 10 • Tests from over a decade ago sit side by side with recent ones. • All of them require maintaining an "all pass" status.
your contribution 11 • Tests with quality standards different from today • Insufficient coverage • Excessive use of the error control operator @ • PHP code written in the style of more than a decade ago • Redundant code • Tests with different execution conditions compared to now • Tests dependent on CI settings • Tests that only run in specific environments • False negative tests
one file, one test suite. • Due to the nature of the tests, implementations avoiding advanced features are required. • Even when sharing code, using `require()` is the limit. Requires pure PHP skills that do not depend on any specific framework.
input (PHP code, function input) • A format often seen in competitive programming and programming learning sites. • The most basic form, both as a test and as a program. Requires pure implementation skills that do not depend on any specific language.
contribution 17 [FEATURE].phpt • Corresponds to a specific feature gh[NUMBER].phpt • Corresponds to GitHub Issue number • The issue will tell you what the test is about bug_[NUMBER].phpt • Corresponds to tickets in the PHP Bug Tracking System • (It is no longer in use.)
php-src is waiting for your contribution 20 1. Pick a feature you like. 2. Spend about an hour reading its tests. • If it's a test for an Issue or Bug, read the original ticket too. 3. You'll quickly find something you want to fix. • Or, you'll discover a way of using PHP you didn't know about. • Or, you'll find various "reasons" from Issue or pull request information.
is waiting for your contribution 21 KentarouTakeda/docker-php-src • My personal build environment. • Following the README will set up a complete environment, including external databases. How to Run Tests • ./run-tests.php [phpt file or directory]
for your contribution 22 • Building PHP — PHP Internals Book • Official resource on building PHP • Somewhat outdated content (translate version to latest) • Running the test suite — PHP Internals Book • Official resource on running PHP tests
23 • 2 years of C experience - but that was 30 years ago Honestly, I can't write C anymore After contributing to testing and CI for a while, • php-src contributor Again, I can't write C! I have reached a point where I can contribute by adding features in C!