Skip to main content
  • Writing PHP Extensions

    To help you learn the basics about PHP, the tutorial we just completed described how to build a very simple practice extension.

  • Writing PHP Extensions

    This extension skeleton can be compiled without any changes.

  • Writing PHP Extensions

    At this point you should already know the basic structure of a PHP extension and the building process. Now, we are going to learn how to implement new basic PHP extension features. Starting from this section, I’ll write new code in red and keep existing code black. 

  • Writing PHP Extensions

    Writing a basic PHP extension is not too difficult.

  • Writing PHP Extensions

    Let’s try to extend our example extension, implementing the following PHP class in C.

  • Writing PHP Extensions

    Let’s review the contents of extension skeleton files.

  • Writing PHP Extensions

    If you remember, each object keeps an object handlers table. We started to use it in the previous chapter on embedding C data.

  • Writing PHP Extensions

    Let’s try to pass array with a value of some unexpected type.

  • Writing PHP Extensions

    The following code shouldn’t modify variable $y but it does.

  • PHP Community Support Lifecycle Changes: What Do They Mean for Your Team?

    The PHP release cycle has followed the same cadence for over a decade, but changes are coming in 2024. Learn more about the upcoming PHP lifecycle changes and what they mean for your