PHP Function Zend_Version
As you may know PHP has a lot of built-in functions. One of them is zend_version, which returns the version of the underlying Zend Engine. This article takes a closer look at this function.
When a function is called in PHP, the arguments are pushed by the engine onto a stack. So, at runtime you can read all of the parameters that were passed to the function. This includes those that were declared inside the function, but also those that were passed by reference.
All non-scalar values like strings, arrays, resources and objects are represented by structures specific to a certain type. Each of these structures has a first 64-bit word that contains the reference-counter, type and flags for use by a garbage collector. This structure also has a pointer to an internal memory region that holds the actual value.
The pointer to this data structure is kept by a zval, which just keeps a pointer to it. This structure can be accessed by calling the function zend_string_safe_alloc(len, number, addition, persistent) to allocate memory for the zend_string and initialize it with the given C string (char*). The function zend_string_copy(zstr, zstr) can create a copy of the zend_string. The function zend_string_equals_literal(zstr1, zstr2) checks the equality of these two "zend_string" structures with a given C string literal.
With the release of PHP 7, there has been a huge boost in performance for typical web applications. This has been largely due to the new just-in-time compiler, which dramatically improves the performance of computationally-heavy algorithms.