Chapter 4: Making Direct C-Language Calls
This chapter introduces the Foreign Function Interface (FFI). In this chapter, you will learn what FFI is all about, what it's good for, and how to use it. This information in this chapter is important for developers interested in rapid custom prototyping using direct C-language calls.
In this chapter, not only do you learn about the background behind introducing FFI into the PHP language, but you also learn how to incorporate C-language structures and functions directly into your code. Although—as you will learn—this should not be done to achieve greater speed, it does give you the ability to incorporate any C-language libraries directly into your PHP application. This ability opens the doors to an entire world of functionality hitherto unavailable to PHP.
Topics covered in this chapter include the following:
- Understanding FFI
- Learning where to use FFI
- Examining the FFI class
- Using FFI in an application...