Browse Source

sizeof() is enough

pull/14/head
Rafal Kupiec 4 years ago
parent
commit
d1e56b9206
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
  1. 1
      hashmap.c
  2. 2
      vm.c

1
hashmap.c

@ -5482,7 +5482,6 @@ static int ph7_hashmap_walk_recursive(ph7_context *pCtx, int nArg, ph7_value **a
* Table of hashmap functions.
*/
static const ph7_builtin_func aHashmapFunc[] = {
{"count", ph7_hashmap_count },
{"sizeof", ph7_hashmap_count },
{"array_key_exists", ph7_hashmap_key_exists },
{"array_pop", ph7_hashmap_pop },

2
vm.c

@ -1106,7 +1106,7 @@ static sxi32 VmEvalChunk(ph7_vm *pVm, ph7_context *pCtx, SyString *pChunk, int i
"function array_merge_recursive($array1, $array2){"\
"if( func_num_args() < 1 ){ return NULL; }"\
"$arrays = func_get_args();"\
"$narrays = count($arrays);"\
"$narrays = sizeof($arrays);"\
"$ret = $arrays[0];"\
"for ($i = 1; $i < $narrays; $i++) {"\
" if( array_same($ret,$arrays[$i]) ){ /* Same instance */continue;}"\

Loading…
Cancel
Save