Posts marked with “php”
Education Station: Locking Down Resources
Many of the applications that we write need to access some form of resource. These resources may come in the form of images we need to display, logs we need to write, or external services we need to pull data from. But, at the end of the day, our applications are accessing things outside of […]
PHP Puzzles: Destination Point
In our last issue, pruned a set of directions to remove values that cancel each other out. It was an exercise in cleaning data, an often crucial step before importing it or processing it elsewhere. In this article, we look at plotting those directions on a grid.
Bug-free Money Handling with MoneyPHP
Do we really know how to handle one of the fundamental business operations—calculating monetary amounts? Floating-point calculations, often used with financial transactions, are notoriously tricky and error-prone because of how computers process them. In this article, we’ll look at how you can avoid making them in your application.
Applying Best Coding Practices to PHP, Part One
When advancing in our careers as developers, we come across some questions about the structure of our software. Before long, the main question about solving a problem is not about what to do anymore, but how to do it elegantly. We start looking for better development tactics and how to make our code mode readable […]
Improving Your PHP with Static Types
As PHP incorporates more features typical of statically typed languages, you have the option of adopting an entirely new programming style. While static typing can make your code easier to understand, refactor, and test, PHP’s implementation isn’t quite the same as other languages. This article covers the state of static typing in PHP and how […]
More Than Asynchronous I/O, Introduction To Swoole PHP
By Bruce Dou Swoole PHP is a coroutine based asynchronous network application framework. It is a PHP extension that extends PHP core and utilizes more power provided by Linux OS. Unlike the callback style single thread asynchronous I/O provided by the other networking libraries like Node.js, Swoole PHP has multiple asynchronous I/O threads and native […]
Sustainable PHP: Refactor to Competitive Advantage
Technical debt is always, and continuously, a challenge. Needs change. This month we’re looking at an approach for being continually prepared for change—refactoring, with unit tests in place.
The Workshop: PHP Development with Homestead in WSL
We’ve spent the past two months talking about Windows Subsystem for Linux (WSL) in Windows 10 and how to customize it to serve as a PHP development environment. While functional, our environment lacked a fair bit of polish. In the nearly four years that I’ve been working on and maintaining Laravel Homestead, I’ve spent much […]
Education Station: Race Conditions and Dead Locks
Despite PHP shifting more and more toward preferring Object-Oriented Programming, at its heart, PHP is a procedural language. All of the code is executed one line at a time, in the order that the parser receives it. To my mind, one of PHP’s strengths is blending a versatile object model along with procedural programming. Web […]
PHP Puzzles: Improved Directions
In our last issue, we simulated population growth—a component of many popular games. In this article, we look at pruning redundant items from a list of directions.