O'Reilly logo

Typed PHP: Stronger Types For Cleaner Code by Christopher Pitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required