~/talk

What can PHP Foreign Function Interface do for you?

links:none on file
slides:none on file

Covers the PHP Foreign Function Interface (FFI) added in PHP 7.4 and demonstrates how to call C libraries directly from PHP without writing an extension in C. Shows how to prototype PHP wrappers around C libraries, explains common pitfalls and limitations of using FFI, and gives guidance on when FFI is an appropriate solution and when a traditional PHP extension is preferable.

AI-written summary · about

  1. 0:00Intro
  2. 0:56What problems does FFI solve?
  3. 1:30Why use FFI?
  4. 2:50Limitation of FFI
  5. 5:20Configuration Only one configuration option in php.ini, named
  6. 6:01Let's rewrite PHP abs() function!
  7. 6:33Talk is cheap, show me the code!
  8. 6:44How FFI maps functions?
  9. 8:41Automatic conversion - "right" function call
  10. 10:35Complex data types - arrays, other observations
  11. 11:05Complex data types - structures
  12. 12:07Creating complex data types
  13. 12:39Passing complex data types
  14. 13:14Get Unix timestamp for a date
  15. 13:30A short story about memory...
  16. 14:12Memory management
  17. 15:44C pointers FF1
  18. 17:53Elements of Carrays and structures
  19. 18:42Complex data types returned by C functions
  20. 20:10Glob, the function which allocates memory
  21. 23:31Glob - complete example
  22. 23:51Callbacks
  23. 24:33leaks resources
  24. 26:20Quicksort - definition
  25. 26:35Quicksort - callback
  26. 27:13Quicksort - passing callback
  27. 27:40Quicksort - complete example
  28. 28:44FFI performance, function calling benchmark
  29. 30:26Is FFI worth it?
  30. 32:23PHP FFI re-evaluation, other side
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.