Skip to content

Commit 0e7bae6

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix ffi stubs
2 parents 74e39ce + 13f898b commit 0e7bae6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ext/ffi/ffi.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ public static function cdef(string $code = "", ?string $lib = null): FFI {}
1010

1111
public static function load(string $filename): ?FFI {}
1212

13-
public static function scope(string $name): ?FFI {}
13+
public static function scope(string $name): FFI {}
1414

1515
public static function new(FFI\CType|string $type, bool $owned = true, bool $persistent = false): ?FFI\CData {}
1616

1717
/** @prefer-ref $ptr */
1818
public static function free(FFI\CData $ptr): void {}
1919

2020
/**
21-
* @param FFI\CData|string|int|null $ptr
21+
* @param FFI\CData|int|float|bool|null $ptr
2222
* @prefer-ref $ptr
2323
*/
2424
public static function cast(FFI\CType|string $type, $ptr): ?FFI\CData {}
@@ -28,7 +28,7 @@ public static function type(string $type): ?FFI\CType {}
2828
/** @prefer-ref $ptr */
2929
public static function typeof(FFI\CData $ptr): FFI\CType {}
3030

31-
public static function arrayType(FFI\CType $type, array $dimensions): ?FFI\CType {}
31+
public static function arrayType(FFI\CType $type, array $dimensions): FFI\CType {}
3232

3333
/** @prefer-ref $ptr */
3434
public static function addr(FFI\CData $ptr): FFI\CData {}
@@ -64,7 +64,7 @@ public static function memcmp($ptr1, $ptr2, int $size): int {}
6464
public static function memset(FFI\CData $ptr, int $value, int $size): void {}
6565

6666
/** @prefer-ref $ptr */
67-
public static function string(FFI\CData $ptr, ?int $size = null): ?string {}
67+
public static function string(FFI\CData $ptr, ?int $size = null): string {}
6868

6969
/** @prefer-ref $ptr */
7070
public static function isNull(FFI\CData $ptr): bool {}

ext/ffi/ffi_arginfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 677c62adf295003b4b2d273995a4bda623d507bf */
2+
* Stub hash: 0b4215e4686f4184b2eef0de7d60e01855725924 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"")
@@ -10,7 +10,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_load, 0, 1, FFI, 1)
1010
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
1111
ZEND_END_ARG_INFO()
1212

13-
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_scope, 0, 1, FFI, 1)
13+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_scope, 0, 1, FFI, 0)
1414
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
1515
ZEND_END_ARG_INFO()
1616

@@ -37,7 +37,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_typeof, 0, 1, FFI\\CTyp
3737
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
3838
ZEND_END_ARG_INFO()
3939

40-
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_arrayType, 0, 2, FFI\\CType, 1)
40+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_arrayType, 0, 2, FFI\\CType, 0)
4141
ZEND_ARG_OBJ_INFO(0, type, FFI\\CType, 0)
4242
ZEND_ARG_TYPE_INFO(0, dimensions, IS_ARRAY, 0)
4343
ZEND_END_ARG_INFO()
@@ -70,7 +70,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_memset, 0, 3, IS_VOID,
7070
ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
7171
ZEND_END_ARG_INFO()
7272

73-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_string, 0, 1, IS_STRING, 1)
73+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_string, 0, 1, IS_STRING, 0)
7474
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
7575
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 1, "null")
7676
ZEND_END_ARG_INFO()

0 commit comments

Comments
 (0)