Skip to content

Commit 1f9da1c

Browse files
committed
Adds 'PHPReturnValue'.
1 parent 4c43aaf commit 1f9da1c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ func PHPValue(value any) unsafe.Pointer {
410410
return unsafe.Pointer(zval)
411411
}
412412

413+
// EXPERIMENTAL: PHPReturnValue is equivalent to PHPValue, but will populate the provided *C.zval directly.
414+
func PHPReturnValue(zval unsafe.Pointer, value any) unsafe.Pointer {
415+
phpValue((*C.zval)(zval), value)
416+
}
417+
413418
func phpValue(zval *C.zval, value any) {
414419
if toZvalObj, ok := value.(toZval); ok {
415420
toZvalObj.toZval(zval)

0 commit comments

Comments
 (0)