PHP 7 / C get value from HashTable -


i'm trying overwrite , old extension php 5.4 php 7. in old code there function double get_arr_value(char *key, hashtable *table) returns (at least should) value of array double. definition this:

double get_arr_value(char *key, hashtable *table) {      double val;      zend_string *zend_key = zend_string_init(key, 3, 0);       if (zend_hash_exists(table, zend_key)) {          zval *zv_dest = zend_hash_find(table, zend_key);           if (zv_dest != null) {              int type = z_type_p(zv_dest);               if(type == is_double) {                  val =  (zv_dest)->value.dval;              } else if(type == is_long) {                  val = (double)((zv_dest)->value.lval);              } else if(type == is_string) {                  val = (double)atof((zv_dest)->value.str->val);              }          }      }       return val; } 

any idea where's problem? i'm not c programmer , i'm little bit lost here.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -