MCPcopy Create free account
hub / github.com/deuill/go-php / Interface

Method Interface

engine/value.go:178–195  ·  view source on GitHub ↗

Interface returns the internal PHP value as it lies, with no conversion step.

()

Source from the content-addressed store, hash-verified

176
177// Interface returns the internal PHP value as it lies, with no conversion step.
178func (v *Value) Interface() interface{} {
179 switch v.Kind() {
180 case Long:
181 return v.Int()
182 case Double:
183 return v.Float()
184 case Bool:
185 return v.Bool()
186 case String:
187 return v.String()
188 case Array:
189 return v.Slice()
190 case Map, Object:
191 return v.Map()
192 }
193
194 return nil
195}
196
197// Int returns the internal PHP value as an integer, converting if necessary.
198func (v *Value) Int() int64 {

Callers 8

SliceMethod · 0.95
MapMethod · 0.95
CallMethod · 0.95
TestValueNewFunction · 0.95
engineReceiverSetFunction · 0.80
TestContextEvalFunction · 0.80
NewValueFunction · 0.80
GetMethod · 0.80

Calls 7

KindMethod · 0.95
IntMethod · 0.95
FloatMethod · 0.95
BoolMethod · 0.95
StringMethod · 0.95
SliceMethod · 0.95
MapMethod · 0.95

Tested by 2

TestValueNewFunction · 0.76
TestContextEvalFunction · 0.64