Sorting indexed arrays

The sort() function sorts the values in an indexed array in ascending order. This means that A comes before Z, and 0 comes before 9. Uppercase letters come before lowercase letters, and all letters come before numbers. For example

All the sorting functions in this tutorial return true on success and false on failure. 


Debugging is one of the most important and significant parts of software development. Finding bugs and errors in any application is a tedious task, so a proper debugging mechanism should be adopted to make the process easier. Without following proper debugging procedures, software bugs and errors can be difficult to locate. As per the PHP programming model, we should be aware of all the tools available for debugging and eliminating malfunctioning components from our software system. In this article, we will concentrate on the core PHP debugging process. The core mechanism consists of using the program to trace errors and discrepancies. The output is gathered through the script execution and displayed at the end of the script.



Normally when we work on software development process, we have to follow Software Development Life Cycle (SDLC) guidelines. The SDLC process consists of different types of steps and one of them is the debugging and testing process. Debugging is an essential part of any software development work.

When we develop a software project, it invariably contains different types of bugs, errors or abnormalities. Debugging is the process of checking, detecting and correcting errors or bugs to allow software programs to function properly.


General Trouble Shooting Strategies

Basic elements of a debugging effort consist of guessing the problem and then fixing it. It does not matter whether we are analyzing an PHP program, a telephone switch, an electronics circuit, or a software program -- certain principles apply, regardless. So we should bear these ideas in mind as we try to figure out what ails our software.



The following assumes that you are familiar with the concept of unit testing, as well as the PHP web development language. It is a guide for a new user with the Simple Test process. If you are new to the unit testing process then it will also help you follow the steps.


Version 1.0 of the Zend Engine functions much like the heart and brain of PHP 4.0. It contains the process that provides the sub-structure and facilities to the functional modules. It also implements the language syntax, as well. The Zend Engine 1.0 is actually the second revision of the PHP scripting engine. It is still based on the same rules as the PHP 3.0 engine that was basically Zend Engine 0.5. Now it is permissible to migrate the path from PHP 3.0 to 4.0. The development has the same ‘state of mind’ as per PHP 3.0. We feel it is right time to start working towards a revision of the Zend Engine. It would also incorporate new structures and solutions to some of the most difficult problems faced by the PHP designer or developers.


In this article I will discuss the Zend Engine internals based on the PHP platform.



Zend Engine is an open source scripting engine which acts as an interpreter for the PHP programming language. This was initially developed by two students at the Technion - Israel Institute of Technology. Zend engine is a virtual machine or VM. As we know that a Virtual machine is nothing but software which simulates a physical computer. The Zend engine consists of multiple components e.g. a compiler, ZFMI (Zend Function Module Interface) and a virtual CPU or an executor.


How Zend Engine Works

A Zend engine consists of three major components:

   → Lexical analyzer or lexer

   → Parser

   → Executor


We know that Zend is a scripting engine and it works as an interpreter. So let us check different phases of a script which is subjected to a Zend engine. The script passes through the following steps and finally gets executed by Zend engine: