public static PHPArray array(params object[] objs) { PHPArray ary = new PHPArray(); foreach (object obj in objs) { ary.Add(obj); } return(ary); }
public static PHPArray array(string[] keys, object[] objs) { if (keys.Length != objs.Length) { throw new ArgumentException("数组数量不一样"); } PHPArray ary = new PHPArray(); for (int i = 0; i < keys.Length; i++) { ary.Add(keys[i], objs[i]); } return(ary); }