791 case 'r':
792 {
793 int64_t id = readInt();
794 Variant *v = getByVal(id);
795 if (!v) throwOutOfRange(id);
796 tvSet(tvToInitCell(v->asTypedValue()), *self.asTypedValue());
797 }
798 break;
799 case 'R':
800 {
801 if (UNLIKELY(mode == UnserializeMode::VecValue)) {
802 throwVecRefValue();
803 } else if (UNLIKELY(mode == UnserializeMode::DictValue)) {
804 throwDictRefValue();
805 } else if (RuntimeOption::EvalHackArrCompatNotices) {
806 raiseHackArrCompatRefNew();
807 }
808
809 int64_t id = readInt();
810 Variant *v = getByRef(id);
811 if (!v) throwOutOfRange(id);
812 self.assignRef(*v);
813 }
814 break;
Related code: