时间:2021-07-01 10:21:17 帮助过:11人阅读
php 的变量是一个 C 语言结构,
能详细解释一下么?不太懂
The string in PHP is implemented as an array of bytes and an integer indicating the length of the buffer.
php是用c++写的,应该也是用"\n"吧
php的变量结构如下:
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;};
php变量有保存字符串长度,所以不需要用符号判断
谢谢各位!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!