php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

Advanced Design & Development

June 2020

PHP adds syntax and slowly adapts to enable new programming techniques. Whether you are comfortable with imperative, object-oriented, or functional programming, the language does make it possible, and new syntax like arrow functions simplify the syntax. This issue looks into asynchronous PHP, new Browser APIs, building REST APIs, callables and closures in PHP, Code Igniter 4, and more!

Asynchronous Programming in PHP

By Lochemem Bruno Michael

PHP is, in many communities, scorned and even trivialized for many reasons—a lack of asynchrony being one of the biggest detractions. Fallacies as egregious as the aforestated derision are intolerable because of the language’s current robustness. Asynchrony—using interleaved processes in a single thread—is available to users of the PHP language to address the inefficiencies of inherently slow input/output operations. We can implement it either via language modules like Swoole or idiomatic PHP solutions like ReactPHP and Amp.

Building a REST API from Scratch

By Gunnard Engebreth

This tutorial walks you through a basic CRUD API using the Slim framework. The intent is to familiarize yourself with RESTful concepts as well as the benefits of using a micro-framework versus a full-fledged one.

Browser APIs: The Unknown Super Heroes

By Rowdy Rabouw

Do you still think browsers are only capable of parsing HTML, CSS, and JavaScript? Think again! Browsers have become much more powerful and contain numerous APIs that can enrich the user experience or are just plain fun. In this article, I’ll show you how to geolocate your users, check their battery status, measure device memory, and check their network connection.

PHP Puzzles: Calculating Fibonacci Sequences

By Sherri Wheeler

Each installment of PHP Puzzles presents a small coding exercise typical of those we might encounter in a job interview, or on a coding challenge website. In the following month, we’ll look at a couple of possible solutions for today’s puzzle. In our last issue, we solved the very common Factorial math problem to get ourselves warmed up. We looked at an iterative and a recursive solution. I then ask readers to solve the similar Fibonacci problem.

Education Station: Calling all Callables

By Chris Tankersley

When facing a challenging problem, you want a flexible codebase that adapts quickly. Object-oriented programming facilitates it by giving you the power through inheritance, encapsulating code in reusable objects, and generally making them work for your application as you see fit. However, we can find flexibility in other programming approaches.

The Workshop: Blasting Off with CodeIgniter 4

By Joe Ferguson

Fourteen years after its first public release and six years after transitioning ownership from EllisLab to British Columbia Institute of Technology CodeIgniter (CI) has released major version 4. It continues to deliver a framework with a small footprint without having to learn a lot of framework vendor-specific functionality. CodeIgniter has always prided itself on clear, thorough documentation and favoring simple solutions over complexity.

Sustainable PHP: The Cost of Change

By Edward Barnard

PHP projects generally focus on rapid development. The PHP ecosystem allows us to develop new ideas in mere hours or even minutes. However, over the years, many PHP projects reach the point where changes take radically longer. There’s a high risk of breaking something else—which is the worst possible outcome when the company depends on that online presence. Here we start at the beginning with the Manifesto for Agile Software Development.

Security Corner: Cross Site Request Forgery

By Eric Mann

Cross-site request forgery (CSRF) is a security risk where an attacker tricks a visitor into making a malicious request to your site from another, entirely unrelated site in their control. This particular vulnerability seemingly disappeared from most teams’ radars a few years ago but is beginning to reappear in the wild.

Community Corner: Let’s Talk Xdebug

By Eric Van Johnson

This month, we take a moment to speak with—well technically email with—a member of the PHP community. We are very fortunate to have a community filled with people who care about making PHP stronger. Today we speak with Derick Rethans (@derickr), author, conference speaker, PHP 7.4 Release Manager, host of the PHP Internal News Podcast, and the creator/maintainer of Xdebug.

finally{}: A Question for You: The Future of Conferences?

By Eli White

I’d like to take this month to turn the microphone around a bit and ask a question of you, the reader. With COVID-19 continuing to shut down most of the world, predictions are looking at potentially 3–12 months of it still affecting us. It may completely change permanently how we, as a society, interact.

Leave a comment

Use the form below to leave a comment: