In this article, I will talk about how object and variable references are controlled in memory, since this is an issue that can generate discussion and differing opinions. One question to ponder is: “By default, are objects passed by reference or by copy in PHP?” I’m going to talk first about what references aren’t in PHP; secondly, I’ll discuss what they are, and finally, I will examine how the garbage collector works in PHP.Continue reading →
Understanding the Input/Output (I/O) model of your application can mean the difference between an application that deals with the load it is subjected to, and one that crumples in the face of real-world uses cases. Perhaps while your application is small and does not serve high loads, it may matter far less. But as your application’s traffic load increases, working with the wrong I/O model can get you into a world of hurt.Continue reading →
PhalconPHP will make your high-load application fast and easy, it’s one of the fastest MVC frameworks for PHP available. It’s written in C and supplied as a compiled PHP extension, so it doesn’t need to be interpreted at every request. Consider PhalconPHP for your next project, you won’t regret it.Continue reading →
Magento built a reputation as an e-commerce market leader, all thanks to its ease of use and customizability. Getting into the framework was only made easier with the release of Magento 2.
In this post, Toptal Software Engineer Gabriel Queiroz Silva gives us a step-by-step tutorial to building your first Magento 2 website.Continue reading →
Fat controllers and models: an inevitable problem for most large-scale projects based on MVC frameworks such as Yii and Laravel. Fortunately, there’s a cure, and it’s in architecting a layered structure.Continue reading →
Many popular languages for web development have their ‘default’ framework, such as Ruby on Rails for Ruby, or Django for Python. However, PHP has no such single default and has multiple popular options to choose from.
In this article, Toptal Freelance Developer Karim Sakhibgareev compares the two most popular PHP frameworks, Symfony and Laravel, explores their features, and establishes guidelines for how PHP developers should choose between them.Continue reading →
It’s every developer’s dream to be more efficient. In this article, you’ll learn how one engineer saved himself from typing more than 20,000 characters over six months and prevented 1,000 bugs in the process.Continue reading →
Making your website or web app available to a wider audience often requires it to be available in multiple languages. For non-English projects, you can increase your audience by releasing it in English as well as your native language. Internationalizing and localizing your project, however, becomes a much easier process if you start during its infancy.
In this article, Toptal Software Engineer Igor Gomes dos Santos shows us how to leverage simple tools, like Gettext and Poedit, to internationalize and localize a PHP project.Continue reading →
WordPress plugins can be both a blessing and a curse. With more than 45,000 plugins available in its official repository, WordPress users can customize their website to their heart’s content. However, not all plugins follow the standards necessary to keep the platform performant and secure while also delivering a solid user experience.
In this tutorial, Toptal Software Engineer Ratko Solaja shows us how to build a robust WordPress plugin, following all the necessary best practices.Continue reading →
Would you like to test your PHP code like a boss? Do you feel that basic unit tests and PHPUnit just don’t cut it anymore? If your answer to both questions is yes, you might want to try Codeception, a mature and well-documented testing framework designed to outperform PHPUnit and Behat.
In this post, Toptal Freelance Software Engineer Vasily Koval describes how he came to take the plunge and start using Codeception, and he explains why you should check out Codeception for your PHP testing needs.Continue reading →
When dealing with time consuming, resource intensive tasks, most PHP developers are tempted to choose the “quick hack route”. We’ve all used “ini_set(‘max_execution_time’, HUGE_INT);” before, but it doesn’t have to be this way.
In today’s tutorial, PHP developer Daniel Gheorghe demonstrates how an application’s user experience may be improved by separating long-running tasks from the main request flow using Laravel.Continue reading →
If you haven’t been working with PHP lately, you might wonder what happened to PHP 6. Why the skip from PHP 5 to PHP 7? Well, long story short, PHP 6 was a failure. To avoid confusion, the new version was renamed PHP 7.
PHP 7 introduces a number of new features, while at the same time dropping depreciated SAPIs and extensions. As a result, it tends to outperform PHP 5.x by a wide margin. Some compatibility issues could pose a problem, but most developers have nothing to worry about.
In this post, Toptal Freelance Software Engineer Vilson Duka explains what makes PHP 7 different, and why it’s time to make the switch.Continue reading →
The Dependency Injection Container in Symfony2 allows components to be injected with their dependencies, and is often used as a Service Locator, which when combined with the DI-container pattern is considered to be an anti-pattern by many.
In this article, Toptal engineer Vasilii Lapin shows us how you can build a simple Symfony2 application using the DI-container, but without implementing the Service Locator pattern.Continue reading →
Developers sometimes run into tasks that require access to email mailboxes. In most cases, this is done using the Internet Message Access Protocol, or IMAP. As a PHP developer, I first turned to PHP’s built in IMAP library, but this library is buggy and impossible to debug or modify. So today we will create a working IMAP email client from the ground up using PHP. We will also see how to use Gmail’s special commands.Continue reading →
Every once in a while PHP developers are charged with tasks that require them to extend the functionalities of legacy projects, a task that often includes building REST APIs. Building a REST API for PHP-based projects is challenging, but in the absence of proper frameworks and tools, it can also be a particularly difficult goal to get right. In this article, Toptal engineer Arminas Zukauskas shares his advice, with sample code, on how to build a modern structured REST API around existing legacy PHP projects.Continue reading →
Log files may very well be one of the most underestimated and underutilized tools at a developer’s disposal. Beyond their value for debugging, with a bit of creativity and forethought, logs files can be leveraged to serve as a valuable source of usage information and analytics. In this article, In this article, Toptal engineer Ilya Sanosyan provides a practical guide to maximizing the value we get from our logs.Continue reading →
Laravel designers didn’t spend too much time reinventing the wheel. A lot of solutions and practices are transferred from other frameworks.
The decision to embrace a new PHP framework should not be taken lightly, so let’s examine why considering Laravel may be worth your time and effort. Toptal freelance software engineer Alex Rytov explains what made him take the plunge and why he believes Laravel has a bright future.Continue reading →
CakePHP is an amazing PHP framework, but it has a steep learning curve! It requires a good amount of research and training to become an expert.
This article describes few bad practices when writing a CakePHP code, and proposes the correct approach to avoid them.Continue reading →
The Cake development team considers CakePHP 3 to be a game changer. With the alpha version of CakePHP 3 now hot out of the oven, this article takes a fresh look at CakePHP as an effective modern framework for PHP development.Continue reading →
PHP makes it relatively easy to build a web-based system, which is much of the reason for its popularity. But its ease of use notwithstanding, PHP has evolved into quite a sophisticated language, with many nuances and subtleties that can bite developers, leading to hours of hair-pulling debugging. This article highlights ten of the more common mistakes that PHP developers need to beware of.Continue reading →
Once you step beyond the comfortable confines of English-only character sets, you quickly find yourself entangled in the wonderfully wacky world of UTF-8.
Indeed, navigating through UTF-8 related issues can be a frustrating and hair-pulling experience. This post provides a concise cookbook for addressing these issues when working with PHP and MySQL in particular, based on practical experience and lessons learned.Continue reading →
I live in Córdoba, Argentina, approximately 130 kilometers (~80 miles) away from the lake where I kitesurf. Thats roughly a two-hour drive, which I can deal with. But I cant deal with the fact that weather forecasts are inaccurate. And where I live, good wind conditions last just a couple of hours. The last thing you want to do is clear up your Monday schedule to go kitesurfing and find yourself cursing the gods on a windless lake after two hours of driving.
I needed to know the wind conditions of my favorite kitesurfing spot—in real time. So I decided to build my own weather station.Continue reading →
Everyone has their own set of tools. As a PHP developer, one of my favorites is a Rapid Application Development framework called “Nooku”. In the words of the development group: “Nooku is more of a web development toolkit than a framework”
In case you are not familiar with it, have a look. It’s an open source project that makes heavy use of industry accepted design patterns to produce highly componentized applications that are easily extensible and reusable (initially created by one of the lead Joomla developers). Out of the box, Nooku gives you a great deal to help get projects off the ground faster. A small, but strong sample:Continue reading →