Re: PHP on 64bit Ubuntu
| From: | Lupus Michaelis | Date: | Wed, 03 Sep 2008 16:17:57 +0000 |
| Subject: | Re: PHP on 64bit Ubuntu | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279420@lists.php.net to get a copy of this message | ||
Robert Cummings a écrit :
Please explain how it can take up more than twice.It is obvious for a C developper. == 8< == Zend/zend.h typedef struct _zval_struct zval; typedef union _zvalue_value { long lval; /* long value */ double dval; /* double value */ struct { char *val; int len; } str; HashTable *ht; /* hash table value */ zend_object_value obj; } zvalue_value; typedef struct _zend_object { zend_class_entry *ce; HashTable *properties; HashTable *guards; /* protects from __get/__set ... recursion */ } zend_object; struct _zval_struct { /* Variable information */ zvalue_value value; /* value */ zend_uint refcount__gc; zend_uchar type; /* active type */ zend_uchar is_ref__gc; }; == 8< == When you write $a = 1 ; The $a variable don't contain only the integer, it contains a lot of more stuff. This stuff is needed by the fact that a variable can contain every types available in PHP. So, I let you calculate the memory needed to store the variable, but you can easily understand that they'll not be twice the previous memory footprint, but a little more. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org