International PHP Conference
The Conference for PHP and Web Development

Workshop: PHP FFI vs extension development: Which approach is better?

Workshop
Until August 19:
✓ PlayStation Classic or C64 Mini for free
✓ Save up to € 495
✓ Group discount
Register now
Bis 19. August:
✓ PlayStation Classic oder C64 Mini gratis
✓ Bis zu 495 € sparen
✓ Kollegenrabatt
Jetzt anmelden
Thank you for attending
✓ See you in 2022!
Danke für Eure Teilnahme
✓ Bis 2022!
Infos
Booking note:
FFI Workshop

In this workshop you will learn how to communicate with external libraries through PHP FFI and how to do exactly the same with PHP extension written in pure C. Together we will overcome common pitfalls and discover when we should write an extension and when FFI.

At the end of workshop you will how to:

  • Call C code from PHP without the necessity of writing an extension.
  • Create simple PHP extensions in C.
  • Distinguish when to use FFI and when to write extensions.

Since PHP 7.4 there is no need to write a PHP extension if we want to use an existing library. But is it really easier to communicate with external libraries through PHP FFI? Doesn’t it make more sense to prioritize the development of extensions regardless of the need to learn another programming language?

 


At the end of workshop you will how to: 
1. Call C code from PHP without the necessity of writing an extension. 
2. Create simple PHP extensions in C.
3. Distinguish when to use FFI and when to write extensions. Structure

I. Block 
1. Introduction of the embeddable database DuckDB and its features.
2. What is PHP FFI and how to use it? 
3. A gentle introduction into C for PHP programmers. 

II. Block 
4. Using DuckDB with FFI. 

III. Block 
5. Introduction to writing PHP extensions. 
6. Writing a PHP extension for DuckDB. 

IV. Block 
7. Writing a PHP extension for DuckDB (continuation). 
8. Comparison of both approaches.

The target audience is intermediate and advanced PHP programmers who are not afraid to get their hands dirty with a little C programming.

Prior knowledge of C is not necessary. All you need is your own computer with Docker installed and at least an elementary knowledge of Linux. Necessary tools except the IDE will be provided in the form of a Linux Docker image. As an IDE you can use any text editor or the trial version of CLion from JetBrains.

Unfortunately, there will not be time to explain the basics of Docker during the workshop, so it is necessary to know Docker well or get familiar with it beforehand. You should at least be able to run Bash in the provided Docker container, as Docker will provide a unified environment across all platforms during the workshop.

Take me to the full program of Zum vollständigen Programm von Munich München .

This Session belongs to the Diese Session gehört zum Programm vom MunichMünchen program. Take me to the program of . Hier geht es zum Programm von Berlin Berlin .

This Session Diese Session belongs to the gehört zum Programm von MunichMünchen program. Take me to the current program of . Hier geht es zum aktuellen Programm von Munich München or oder Berlin Berlin .

Stay tuned!

Behind the Tracks of IPC

PHP Core & Coding
Best practices & applications

General Web Development
Broader web development topics

DevOps & Continuous Delivery
Learn about DevOps and transform your development pipeline

Software Architecture
All about PHP frameworks, concepts & environments

Web Security
All about web security

Software Quality
More about software testing tools & strategies

Agile & Company Culture
Getting agile right is so important

Content Management Systems
Sessions on content management systems

#slideless (pure coding)
See how technology really works

PHP Frameworks
All about PHP Frameworks

Docker, Kubernetes, Cloud
Cloud-based & native apps