Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is exactly a zend extension?

if you look at this documentation, the first parameter returns only Zend extensions. What is exactly a Zend extension, as compared to a PHP ("simple") extension?

like image 486
Bob5421 Avatar asked Jun 19 '16 07:06

Bob5421


1 Answers

A Zend extension hooks into "lower levels" of the language. A single extension can be both a PHP extension AND a Zend extension as well. Xdebug is both, for example, using the Zend extension component to hook into lower layers of the language to intercept calls for debugging.

Zend extensions are extensions to the Zend Engine (ZE) itself, which is the lowest level of the PHP stack.

The PHP Wiki offers a lot of additional information. I will quote the introduction:

As you should know, we distinguish between “PHP extensions” and “Zend extensions”. Consider this vocabulary to follow the article, as internally, the sources prefer talking about PHP extensions as “modules” and Zend extensions as “extensions”. We'll keep the more clear “PHP extension” vs “Zend extension” wordings.

Both extension kinds share lots of stuff. The difference between both types is mainly in hooks they register into the Engine. Remember that, despite it is very uncommon, an extension can be both a PHP extension and a Zend extension at the same time. Xdebug is a good example.

Zend extensions are also loaded before PHP extensions are loaded, generally.

An example PHP extension is the PHP Redis Extension. This is a PHP-only extension and does not directly hook into the Zend Engine.

like image 121
Will Avatar answered Nov 15 '22 11:11

Will