| 286 | } |
| 287 | |
| 288 | engine_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 | |
| 311 | engine_value *value_array_index_get(engine_value *arr, unsigned long idx) { |
| 312 | HashTable *h = NULL; |
nothing calls this directly
no test coverage detected