beresta_string_free($pointer); } } /** * Заимствованная строка const char*: уже строка PHP или, на всякий * случай, указатель; NULL — пустая строка. Освобождать её нельзя. * * A borrowed const char* string: already a PHP string or, just in case, * a pointer; NULL is an empty string. It must not be freed. */ public static function borrowed(mixed $value): string { if (is_string($value)) { return $value; } if ($value instanceof CData) { return FFI::string($value); } return ''; } }