/** * Returns true for numeric * * @param env the calling environment * @param v the value to test * * @return true for numeric */ public static boolean is_numeric(Env env, @ReadOnly Value v) { return v.isNumeric(); }
/** * Returns true for a real * * @param v the value to test * * @return true for a real */ public static boolean is_real(@ReadOnly Value v) { return is_float(v); }
/** * Converts to a string * * @param env the quercus calling environment * @param v the variable to convert * @return the double value */ public static Value strval(Env env, @ReadOnly Value v) { return v.toString(env); }
/** * Converts to a double * * @param v the variable to convert * @return the double value */ public static Value doubleval(@ReadOnly Value v) { return floatval(v); }
/** * Returns true for an empty variable. * * @param v the value to test * * @return true if the value is empty */ public static boolean empty(@ReadOnly Value v) { return v.isEmpty(); }
/** * Returns true for an array. * * @param v the value to test * * @return true for an array */ public static boolean is_array(@ReadOnly Value v) { return v.isArray(); }
/** * Returns true if the value is a resource */ public boolean is_resource(@ReadOnly Value value) { return value.isResource(); }
/** * Returns the current value of the array. */ public static Value pos(@ReadOnly Value value) { return current(value); }
/** * Converts to a long * * @param v the variable to convert * @return the double value */ public static Value intval(@ReadOnly Value v) { return v.toLongValue(); }
/** * Returns the current key of the array. */ public static Value key(@ReadOnly Value value) { return value.key(); }
/** * Returns the type string for the variable */ public static String gettype(@ReadOnly Value v) { return v.getType(); }
/** * Returns true for an integer * * @param v the value to test * * @return true for a double */ public static Value is_integer(@ReadOnly Value v) { return is_int(v); }
/** * Returns true for an integer * * @param v the value to test * * @return true for a double */ public static Value is_long(@ReadOnly Value v) { return is_int(v); }
/** * Returns true for null * * @param v the value to test * * @return true for null */ public static boolean is_null(@ReadOnly Value v) { return v.isNull(); }
/** * Returns true for an object * * @param env the calling environment * @param v the value to test * * @return true for object */ public static boolean is_object(Env env, @ReadOnly Value v) { return v.isObject(); }
/** * Converts to a double * * @param v the variable to convert * @return the double value */ public static Value floatval(@ReadOnly Value v) { return new DoubleValue(v.toDouble()); }
/** * Returns the size of the array. */ public static long sizeof(Env env, @ReadOnly Value value, @Optional int countMethod) { return count(env, value, countMethod); }
/** * Serializes the value to a string. */ public static String serialize(Env env, @PassThru @ReadOnly Value v) { StringBuilder sb = new StringBuilder(); v.serialize(env, sb, new SerializeMap()); return sb.toString(); }