aip = calloc(argc + 1 + !!impl->func->vararg, sizeof(*aip));
fi = (zend_internal_function_info *) &aip[0];
+#ifdef ZEND_TYPE_ENCODE
+ fi->type = ZEND_TYPE_ENCODE(psi_internal_type(impl->func->return_type), 1);
+#else
fi->allow_null = 1;
+ fi->type_hint = psi_internal_type(impl->func->return_type);
+#endif
fi->required_num_args = psi_impl_num_min_args(impl);
fi->return_reference = impl->func->return_reference;
- fi->type_hint = psi_internal_type(impl->func->return_type);
if (impl->func->vararg) {
struct psi_impl_arg *vararg = impl->func->vararg;
zend_internal_arg_info *ai = &aip[argc];
ai->name = vararg->var->name;
+#ifdef ZEND_TYPE_ENCODE
+ ai->type = ZEND_TYPE_ENCODE(psi_internal_type(vararg->type), 1);
+#else
ai->allow_null = 1;
ai->type_hint = psi_internal_type(vararg->type);
+#endif
if (vararg->var->reference) {
ai->pass_by_reference = 1;
}
zend_internal_arg_info *ai = &aip[i];
ai->name = iarg->var->name;
+#ifdef ZEND_TYPE_ENCODE
+ ai->type = ZEND_TYPE_ENCODE(psi_internal_type(iarg->type), 1);
+#else
+ ai->allow_null = 1;
ai->type_hint = psi_internal_type(iarg->type);
+#endif
if (iarg->var->reference) {
ai->pass_by_reference = 1;
}
- /* FIXME: if (iarg->var->reference || (iarg->def && iarg->def->type == PSI_T_NULL)) */
- ai->allow_null = 1;
}
return aip;
struct psi_set_exp *sub_exp;
psi_plist_get(set->inner, 0, &sub_exp);
- RETVAL_STRINGL(str, psi_long_num_exp(sub_exp->data.num, frame));
+ RETVAL_STRINGL(str, psi_long_num_exp(sub_exp->data.num, frame, NULL));
} else {
RETVAL_EMPTY_STRING();
}
} else {
tmp->ptr = "";
}
- } else if (0 && Z_TYPE_P(zvalue) == IS_STRING) {
- tmp->ptr = Z_STRVAL_P(zvalue);
} else {
zend_string *zs = zval_get_string(zvalue);
tmp->ptr = estrdup(zs->val);
return tmp;
}
+#if 0
static impl_val *iterate(impl_val *val, size_t size, unsigned i, impl_val *tmp)
{
memset(tmp, 0, sizeof(*tmp));
memcpy(tmp, ((char *) val) + size * i, size);
return tmp;
}
+#endif
/*
* set $ivar = to_array(dvar,
}
psi_plist_get(set->inner, 0, &sub_exp);
- count = psi_long_num_exp(sub_exp->data.num, frame);
+ count = psi_long_num_exp(sub_exp->data.num, frame, NULL);
psi_plist_get(set->inner, 1, &sub_exp);
for (ptr = (char *) ret_val; 0 < count--; ptr += size) {