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

Function value_array_next_get

engine/value.c:288–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288engine_value *value_array_next_get(engine_value *arr) {
289 HashTable *h = NULL;
290 engine_value *val = value_new();
291
292 switch (arr->kind) {
293 case KIND_ARRAY:
294 case KIND_MAP:
295 h = Z_ARRVAL_P(arr->internal);
296 break;
297 case KIND_OBJECT:
298 h = Z_OBJPROP_P(arr->internal);
299 break;
300 default:
301 // Attempting to return the next index of a non-array value will return
302 // the value itself, allowing for implicit conversions of scalar values
303 // to arrays.
304 value_set_zval(val, arr->internal);
305 return val;
306 }
307
308 VALUE_ARRAY_NEXT_GET(h, val);
309}
310
311engine_value *value_array_index_get(engine_value *arr, unsigned long idx) {
312 HashTable *h = NULL;

Callers

nothing calls this directly

Calls 2

value_newFunction · 0.85
value_set_zvalFunction · 0.85

Tested by

no test coverage detected