Ejemplo n.º 1
0
TypedValue* HHVM_FUNCTION(pack, ActRec* ar) {
  int num = ar->numArgs();
  String format(getArg<KindOfString>(ar,0));
  Array extra = Array::Create();
  for (int i = 1; i<num; i++) {
    extra.append(getArgVariant(ar,i));
  }
  Variant result = ZendPack().pack(format, extra);
  // pack() returns false if there was an error
  if (!result.isBoolean()) {
    tvCastToStringInPlace(result.asTypedValue());
  }
  return arReturn(ar, std::move(result));
}
Ejemplo n.º 2
0
Variant HHVM_FUNCTION(unpack, const String& format, const String& data) {
  return ZendPack().unpack(format, data);
}
Ejemplo n.º 3
0
Variant HHVM_FUNCTION(pack, const String& format, const Array& argv) {
  // pack() returns false if there was an error, String otherwise
  return ZendPack().pack(format, argv);
}
Ejemplo n.º 4
0
Variant f_unpack(const String& format, const String& data) {
  return ZendPack().unpack(format, data);
}
Ejemplo n.º 5
0
Variant f_pack(int _argc, const String& format, CArrRef _argv /* = null_array */) {
  return ZendPack().pack(format, _argv);
}
Ejemplo n.º 6
0
Variant f_unpack(CStrRef format, CStrRef data) {
  return ZendPack().unpack(format, data);
}