EXPERIMENTAL: GoString copies a zend_string to a Go string.
(s unsafe.Pointer)
| 34 | |
| 35 | // EXPERIMENTAL: GoString copies a zend_string to a Go string. |
| 36 | func 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 |
no outgoing calls