github.com/trim21/go-phpserialize@v0.0.22-0.20240301204449-2fca0319b3f0/unmarshal.go (about)

     1  package phpserialize
     2  
     3  type Unmarshaler interface {
     4  	UnmarshalPHP([]byte) error
     5  }
     6  
     7  func Unmarshal(data []byte, v any) error {
     8  	if len(data) == 0 {
     9  		return nil
    10  	}
    11  
    12  	return unmarshal(data, v)
    13  }