Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Contributing to PHP's Core

Contributing to PHP's Core

Ever wanted to contribute to PHP's Core? This is your time! From tests to a new function, PHP is open for new contributors. Fixing bugs, document things, cleanups, refactorings, or even new small functions. In this talk, we're gonna see how the is_countable function was made, and what we can learn from that.


Gabriel Caruso

November 09, 2019

More Decks by Gabriel Caruso

Other Decks in Technology


  1. Contributing to PHP's Core by Gabriel Caruso ScotlandPHP 2019

  2. https://youtu.be/8BTxmPppPeQ

  3. Who am I? • Backend Developer at Usabilla by Survey

    Monkey • Communities member • OSS contributor • Talks/Stickers/ELEPHANTS lover
  4. Why did I decide to contribute to PHP's Source Code?

  5. We at Doctrine have a repository called coding-standard where we

    define our style rules - Style - Code smell - Defense programming - Best practices
  6. compact() function https://php.net/compact

  7. None
  8. "Any strings that are not set will simply be skipped."

  9. None
  10. What if the compact() function starts to report undefined variables?

  11. Ok, questions: - How do I even find the code

    that "runs" PHP? - Can I contribute to it? - What do I need to know (technologies) to understand it? - How does it work? - Will they accept this change? - Ok, enough
  12. Where is the PHP’s Core?

  13. https://git.php.net

  14. https://github.com/php/php-src

  15. Anyone can contribute to it?

  16. Yes PHP's Source Code is open source "Open source software

    is a software with source code that anyone can inspect, modify, and enhance."
  17. How do I understand it?

  18. Programming Language - Lexer - Parser - Compilation - Interpretation

  19. PHP is a C codebase

  20. Would they accept my proposal?

  21. RFC Request For Comments, a.k.a, discuss the feature until everyone

    has no more questions about the implementation - Formal document - Voting
  22. Right, now I knew what I need to do: -

    Open a pull request to php/php-src on GitHub - Write and open for voting a RFC
  23. How could I learn how to code for the Core?

  24. The Community

  25. Sammy Kaye The PHP Roundtable guy

  26. Writing tests for PHP source In this course, he teaches

    how you can compile the PHP Source and also how to write tests to PHP
  27. Nikita Popov THE man

  28. How to add new (syntactic) features to PHP In that

    article, Nikita teaches how the Parser, Lexer and Zend Virtual Machine (VM) work
  29. PHP Internals Book That book explains a lot of parts

    of the Internals. Introduce the picture of a book here
  30. Why should you contribute to PHP's Source Code?

  31. Is Coding the only way?

  32. NO! Documentation, extensions, discussion, bug report...

  33. Andreas Heigl He is leading a team to migrate the

    PHP Documentation from SVN to Git and mirror that on GitHub
  34. Derick Rethans Author of Xdebug, he has the knowledge to

    help anyone create an extension for PHP
  35. Ondrej Mirtes Author of PHPStan, his project is changing the

    way we think about PHP
  36. You can change PHP! And you can do it in

    some many ways...
  37. @carusogabriel Questionings? Thank you ♡