© Christopher Pitt 2016

Christopher Pitt, Typed PHP, 10.1007/978-1-4842-2114-3_4

4. Design

Christopher Pitt

(1)Cape Town, Western Cape, South Africa

Now that we’re familiar with the tools at our disposal, it’s time to put them together into a library we can proudly reuse.

In this chapter we’ll organize the “core” functions we want to keep and get rid of the noise. We’ll also learn how to package the functions we want with the C extensions we saw in the previous chapter.

Which Method to Use

We’ve had a look at some methods and extensions that can help us to abstract away the inconsistent type handling PHP presents to us. Part of creating this abstraction is deciding on which methods and/or extensions to use.

Namespace Methods

We should avoid any method ...

Get Typed PHP: Stronger Types For Cleaner Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.