MCPcopy Index your code
hub / github.com/php/frankenphp / GoString

Function GoString

types.go:36–44  ·  view source on GitHub ↗

EXPERIMENTAL: GoString copies a zend_string to a Go string.

(s unsafe.Pointer)

Source from the content-addressed store, hash-verified

34
35// EXPERIMENTAL: GoString copies a zend_string to a Go string.
36func GoString(s unsafe.Pointer) string {
37 if s == nil {
38 return ""
39 }
40
41 zendStr := (*C.zend_string)(s)
42
43 return C.GoStringN((*C.char)(unsafe.Pointer(&zendStr.val)), C.int(zendStr.len))
44}
45
46// EXPERIMENTAL: PHPString converts a Go string to a zend_string with copy. The string can be
47// non-persistent (automatically freed after the request by the ZMM) or persistent. If you choose

Callers 10

TransformMethod · 0.92
SetDataMethod · 0.92
test_uppercaseFunction · 0.92
greetFunction · 0.92
SetNameMethod · 0.92
TestGoStringFunction · 0.85
go_log_attrsFunction · 0.85
go_mercure_publishFunction · 0.85
goArrayFunction · 0.85
goValueFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGoStringFunction · 0.68