MCPcopy Create free account
hub / github.com/deuill/go-php / value_array_size

Function value_array_size

engine/value.c:217–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217unsigned int value_array_size(engine_value *arr) {
218 switch (arr->kind) {
219 case KIND_ARRAY:
220 case KIND_MAP:
221 return Z_ARRVAL_P(arr->internal)->nNumOfElements;
222 case KIND_OBJECT:
223 // Object size is determined by the number of properties, regardless of
224 // visibility.
225 return Z_OBJPROP_P(arr->internal)->nNumOfElements;
226 case KIND_NULL:
227 // Null values are considered empty.
228 return 0;
229 }
230
231 // Non-array or object values are considered to be single-value arrays.
232 return 1;
233}
234
235engine_value *value_array_keys(engine_value *arr) {
236 HashTable *h = NULL;

Callers 1

value_array_keysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected