Slide 1

Slide 1 text

PHP Internals: coding for the Core by Gabriel Caruso phpCE 2018

Slide 2

Slide 2 text

Who am I? ● Backend Developer at Leroy Merlin BRAZIL ● PHP enthusiastic ● PHPSP member ● OSS contributor ● Refactor/Talker/Stickers/ELEPHANTS lover

Slide 3

Slide 3 text

Agenda Background- Where is PHP source code? - Building the Core - Coding a new function for PHP - Writing tests for PHP’s Core - Conclusion -

Slide 4

Slide 4 text

Background

Slide 5

Slide 5 text

Background

Slide 6

Slide 6 text

Background

Slide 7

Slide 7 text

Background

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Background

Slide 12

Slide 12 text

Where’s the PHP’s Core?

Slide 13

Slide 13 text

https://git.php.net

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

How do we “use” the Core?

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Let’s code a function for PHP

Slide 23

Slide 23 text

Couple of PHP’s Core stuff before we move on - .h files are the “””Interfaces””” of the .c files - C has macros, that we can understand as helper functions - C compiles the changed code every time we change it - Zend Parse Parameters (ZPP)

Slide 24

Slide 24 text

https://github.com/php/php-src/blob/master/CONTRIBUTING.md#php-source-code-directory-structure

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Writing tests for PHP - .phpt files are test files of php-internals - They are written in PHP - They have they on unique structure

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Thank you