Category Archives: Tutorials

A new type of PHP, part 2: Scalar types


In our last installment, we talked about the benefits of more robust variable typing in PHP 7, and specifically the new support for typed return values.  That is already a big boon to the maintainability of our code, but PHP 7 goes a step further. So far, we’ve only talked about typing against classes and interfaces.  We’ve been able to… Read more »

A new type of PHP, part 1: Return types


Every significant release of PHP adds a number of new features, with one or two that really define the release.  For PHP 5.3, it was namespaces and anonymous functions.  For PHP 5.4, it was traits.  For PHP 5.5, generators.  For PHP 5.6, variadics. While PHP 7 has a large array of new improvements to make developers lives easier and involve… Read more »

Introducing Z-Ray on Azure

Z-Ray on Azure Screen 7

This article introduces a new and cool way to develop PHP on the cloud, with Z-Ray on Microsoft Azure. You’ve probably already heard of Z-Ray, but just in case you haven’t – here’s a short recap. Z-Ray is an advanced debugging and productivity tool for PHP developers that provides info on what’s going on under the hood of your apps,… Read more »

Debugging PHP Web Apps in a Docker Container

Debugging is an essential task of software development in any programming language. Unfortunately, the out-of-the-box experience with debugging in PHP is not always great. The “stock” PHP binaries available at do not come configured with either of the two popular debug servers Xdebug and Zend Debugger. Developers are required to do additional configuration to make debugging possible with their… Read more »

Develop Your First Zend Server Plugin – Part 1

Zend Server 8.5 introduces a brand-new concept called “Plugins”. This concept is centered around the Zend Gallery – a marketplace for plugins that extend Zend Server functionality, and that were developed by, and for, the Zend Server user community. What are plugins? Put simply, plugins are pieces of code that can extend Zend Server in either, or both, of the… Read more »

Mocking Hard Dependencies in Legacy Code

I’m working on an application that’s been around for a while. It uses a lot of static methods, and often, it instantiates objects from inside methods. This makes it a pain to test, and introducing tests is part of my job. Sometimes I’m able to refactor the code so that dependencies may be injected, but many times I can’t confidently… Read more »

How to Use Composer with External Tools

Composer support in Zend Studio is quite simple. Sometimes users complain about lack of support for additional arguments e.g. for ‘install’ or ‘update’ commands. The new Zend Studio release includes support for running external programs inside your IDE. It’s called External Tools, and it’s well known to Eclipse users. It can be easily used to fill the gap between Composer… Read more »

Code Faster with the New Smart Object Operator Shortcut

Some PHP operators (e.g. ->, ::) can be quite a challenge for people who are used to different languages (like Java or C#). The new Zend Studio release introduces a new shortcut that will help developers work with: Object Operator (->) and Scope Resolution Operator (::), also called Paamayim Nekudotayim. To use it just press CTRL + . (dot) in… Read more »

How to develop a Z-Ray Extension

A new tutorial describing how to develop a Z-Ray extension was published on the Zend blog. The tutorial demonstrates just how easy it is to extend Z-Ray by adding new panels with information you think is important for your development work. Using the publicly available extension APIs (, you can easily customize existing Z-Ray panels, or plug in your own… Read more »

PHP 5.6 in Zend Studio 12 Early Access Version (for experimentation only)

The latest Zend Studio 12 Early Access includes support for PHP 5.6. Every user can install the new PHP binaries through the Welcome Screen (Help > Welcome Screen), but note that they are marked as experimental at the moment. You can also easily add your own version of PHP executables. First of all you need to have working pack with… Read more »