|
IntroFor working with variables in PHP's core you have to learn about different fundamental concepts used in PHP. Firstly PHP is a dynamic and weak typed language. Secondly PHP uses a copy on write mechanism with reference counting for memory handling. Please check the Основы подсчета ссылок chapter for details how reference counting and references work. PHP variables, in general, consist out of two things: The label, which might, for instance, be an entry in a symbol table, and the actual variable container. For the most parts of this manual we will focus on the variable container.
The variable container, in code called typedef struct _zval_struct zval; typedef union _zvalue_value { long lval; /* long value */ double dval; /* double value */ struct { /* string type */ char *val; int len; } str; HashTable *ht; /* hash table value */ zend_object_value obj; } zvalue_value; struct _zval_struct { /* Variable information */ zvalue_value value; /* value */ zend_uint refcount__gc; zend_uchar type; /* active type */ zend_uchar is_ref__gc; };
In the
Now the good message is that you don't have to know these things in detail
as there are - like always in PHP - acces macros. The bad news is that there
are many of them: There are macros to access any aspect of the
|
|