Currently phpserialize throws ValueError('unexpected opcode') in the case where it encounteres a reference in the serialized data of form r:<Index of variable to be referenced to>. This limitation makes phpserialize able to only handle a subset of all PHP generated serialized data.