Please explain please explain please explain
Reply content:
Please explain please explain please explain
struct {union {long lval;double dval;struct {char *val;int len;} str; HashTable *ht;zend_object_value obj; Value;zend_uint Refcount;zend_uchar Type;zend_uchar Is_ref;} Zval; Php_function (explain) {Zval *uservar;if (zend_parse_parameters (Zend_num_args () tsrmls_cc, "Z", uservar) = = FAILURE) { Return_null ();} Switch (z_type_p (Uservar)) {case is_null:php_printf ("NULL"), Break;case is_bool:php_printf ("Boolean:%s", Z_lval_p ( Uservar)? "TRUE": "FALSE"); Break;case is_long:php_printf ("LONG:%ld", Z_lval_p (Uservar)); Break;case is_double:php_printf (" Double:%f ", Z_dval_p (Uservar)); Break;case is_string:php_printf (" STRING: "); Phpwrite (Z_strval_p (Uservar), Z_strlen_p (Uservar));p hp_printf (""); Break;case is_resource:php_printf ("RESOURCE"); Break;case is_array:php_printf ("ARRAY"), Break;case is_object:php_printf ("OBJECT"); break;default:php_printf (" Unknown ");} Return_true;}
PHP does not have an array, is actually used by the Hashtable, the name of the array is misinformation, like the world has no road, the number of people to go to the place called the road
I only know PHP inside:
indexed array [1,2,3,6,6,90]
Associative array [' a ' = = 1, ' b ' and ' = 9, ' f ' = = Ko]
An enumerated array in PHP is also referred to as an associative array, and the subscript of an associative array is that the key value can be unordered, usually a string type;
array('one'=>'1','three'=>'2', 'fore'=>'3')
;
The subscript (key) of an indexed array is ordered and generally int
type, such as:
array('one', 'two', 'three')
The default subscript for this array is 0,1,2
;(: the subscript of an indexed array starts from 0 by default )