Skip to content

Add support for generating MAY_BE_ARRAY_OF_REF func info flag #7416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions Zend/Optimizer/zend_func_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
}

static const func_info_t old_func_infos[] = {
/* zend */
F1("get_class_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
F1("get_defined_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),

/* ext/standard */
F1("parse_ini_file", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
F1("parse_ini_string", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_DOUBLE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
Expand Down Expand Up @@ -165,18 +161,8 @@ static const func_info_t old_func_infos[] = {
F1("stream_bucket_new", MAY_BE_OBJECT),
F1("sys_get_temp_dir", MAY_BE_STRING),

/* ext/preg */
F1("preg_grep", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),

F1("utf8_encode", MAY_BE_STRING),
F1("utf8_decode", MAY_BE_STRING),

/* ext/filter */
F1("filter_var_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),

/* ext/spl */
F1("iterator_to_array", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),

};

static HashTable func_info;
Expand Down
9 changes: 7 additions & 2 deletions Zend/Optimizer/zend_func_infos.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
static const func_info_t func_infos[] = {
F1("zend_version", MAY_BE_STRING),
FN("func_get_args", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY),
F1("get_class_vars", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("get_class_methods", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("get_included_files", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
FN("set_error_handler", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_OBJECT|MAY_BE_NULL),
Expand All @@ -13,6 +14,7 @@ static const func_info_t func_infos[] = {
F1("get_declared_traits", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("get_declared_interfaces", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("get_defined_functions", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY),
F1("get_defined_vars", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("get_resource_type", MAY_BE_STRING),
F1("get_loaded_extensions", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("get_defined_constants", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY),
Expand Down Expand Up @@ -80,7 +82,8 @@ static const func_info_t func_infos[] = {
F1("finfo_file", MAY_BE_STRING|MAY_BE_FALSE),
F1("finfo_buffer", MAY_BE_STRING|MAY_BE_FALSE),
F1("mime_content_type", MAY_BE_STRING|MAY_BE_FALSE),
F1("filter_input_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE|MAY_BE_NULL),
F1("filter_input_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF|MAY_BE_FALSE|MAY_BE_NULL),
F1("filter_var_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF|MAY_BE_FALSE|MAY_BE_NULL),
F1("filter_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
F1("gd_info", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE),
F1("imagecreatetruecolor", MAY_BE_OBJECT|MAY_BE_FALSE),
Expand Down Expand Up @@ -328,6 +331,7 @@ static const func_info_t func_infos[] = {
FN("preg_filter", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
FN("preg_replace_callback", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
F1("preg_split", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
F1("preg_grep", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF|MAY_BE_FALSE),
F1("pg_dbname", MAY_BE_STRING),
F1("pg_options", MAY_BE_STRING),
F1("pg_port", MAY_BE_STRING),
Expand Down Expand Up @@ -363,7 +367,7 @@ static const func_info_t func_infos[] = {
F1("pg_result_error_field", MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL),
F1("pg_get_result", MAY_BE_OBJECT|MAY_BE_FALSE),
F1("pg_result_status", MAY_BE_STRING|MAY_BE_LONG),
F1("pg_get_notify", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("pg_get_notify", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY),
F1("pg_socket", MAY_BE_RESOURCE|MAY_BE_FALSE),
F1("pg_meta_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
F1("pg_convert", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
Expand All @@ -387,6 +391,7 @@ static const func_info_t func_infos[] = {
F1("class_uses", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
F1("spl_classes", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING),
F1("spl_object_hash", MAY_BE_STRING),
F1("iterator_to_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
F1("base64_encode", MAY_BE_STRING),
F1("base64_decode", MAY_BE_STRING|MAY_BE_FALSE),
F1("long2ip", MAY_BE_STRING|MAY_BE_FALSE),
Expand Down
8 changes: 8 additions & 0 deletions Zend/zend_builtin_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ function is_subclass_of(mixed $object_or_class, string $class, bool $allow_strin
/** @param object|string $object_or_class */
function is_a(mixed $object_or_class, string $class, bool $allow_string = false): bool {}

/**
* @return array<string, mixed|ref>
* @refcount 1
*/
function get_class_vars(string $class): array {}

function get_object_vars(object $object): array {}
Expand Down Expand Up @@ -127,6 +131,10 @@ function get_declared_interfaces(): array {}
*/
function get_defined_functions(bool $exclude_disabled = true): array {}

/**
* @return array<string, mixed|ref>
* @refcount 1
*/
function get_defined_vars(): array {}

/**
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_builtin_functions_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 830eee0780adba8fc87cd5aed7f755d4d85ed82b */
* Stub hash: f87d92c002674c431827895a8d8b3a5da3b95482 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand Down
43 changes: 28 additions & 15 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ArrayType extends SimpleType {

public static function createGenericArray(): self
{
return new ArrayType(Type::fromString("int|string"), Type::fromString("mixed"));
return new ArrayType(Type::fromString("int|string"), Type::fromString("mixed|ref"));
}

public function __construct(Type $keyType, Type $valueType)
Expand Down Expand Up @@ -205,6 +205,7 @@ public static function fromString(string $typeString): SimpleType
case "mixed":
case "static":
case "never":
case "ref":
return new SimpleType(strtolower($typeString), true);
case "array":
return ArrayType::createGenericArray();
Expand Down Expand Up @@ -358,6 +359,8 @@ public function toOptimizerTypeMaskForArrayValue(): string {
return "MAY_BE_ARRAY_OF_RESOURCE";
case "mixed":
return "MAY_BE_ARRAY_OF_ANY";
case "ref":
return "MAY_BE_ARRAY_OF_REF";
default:
throw new Exception("Type $this->name cannot be an array value");
}
Expand Down Expand Up @@ -397,23 +400,20 @@ class Type {
/** @var SimpleType[] */
public $types;

/**
* @param SimpleType[] $types
*/
public function __construct(array $types) {
$this->types = $types;
}

public static function fromNode(Node $node): Type {
if ($node instanceof Node\UnionType) {
return new Type(array_map(['SimpleType', 'fromNode'], $node->types));
}

if ($node instanceof Node\NullableType) {
return new Type([
SimpleType::fromNode($node->type),
SimpleType::null(),
]);
return new Type(
[
SimpleType::fromNode($node->type),
SimpleType::null(),
]
);
}

return new Type([SimpleType::fromNode($node)]);
}

Expand Down Expand Up @@ -443,6 +443,7 @@ public static function fromString(string $typeString): self {

if ($char === "|") {
$simpleTypeName = trim(substr($typeString, $simpleTypeOffset, $i - $simpleTypeOffset));

$simpleTypes[] = SimpleType::fromString($simpleTypeName);

$simpleTypeOffset = $i + 1;
Expand All @@ -452,6 +453,13 @@ public static function fromString(string $typeString): self {
return new Type($simpleTypes);
}

/**
* @param SimpleType[] $types
*/
private function __construct(array $types) {
$this->types = $types;
}

public function isScalar(): bool {
foreach ($this->types as $type) {
if (!$type->isScalar()) {
Expand All @@ -473,9 +481,14 @@ public function isNullable(): bool {
}

public function getWithoutNull(): Type {
return new Type(array_filter($this->types, function(SimpleType $type) {
return !$type->isNull();
}));
return new Type(
array_filter(
$this->types,
function(SimpleType $type) {
return !$type->isNull();
}
)
);
}

public function tryToSimpleType(): ?SimpleType {
Expand Down
6 changes: 5 additions & 1 deletion ext/date/php_date.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST =

function timezone_offset_get(DateTimeZone $object, DateTimeInterface $datetime): int {}

/** @refcount 1 */
/**
* @return array<int|string, mixed>|false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return array<int|string, mixed>|false
* @return array<int, array>|false

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I merged it too fast. I'll create a followup.

* @refcount 1
*/
function timezone_transitions_get(
DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {}

Expand Down Expand Up @@ -411,6 +414,7 @@ public function getName(): string {}
public function getOffset(DateTimeInterface $datetime): int {}

/**
* @return array<int|string, mixed>|false
* @tentative-return-type
* @alias timezone_transitions_get
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/date/php_date_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 0f3ef0e61bf6b00a4e33375282097b3dfa51da66 */
* Stub hash: e4821eb3a38823fe1aee397d8e949fdcaa570a4f */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0)
Expand Down
1 change: 1 addition & 0 deletions ext/filter/filter.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function filter_var(mixed $value, int $filter = FILTER_DEFAULT, array|int $optio
/** @refcount 1 */
function filter_input_array(int $type, array|int $options = FILTER_DEFAULT, bool $add_empty = true): array|false|null {}

/** @refcount 1 */
function filter_var_array(array $array, array|int $options = FILTER_DEFAULT, bool $add_empty = true): array|false|null {}

/**
Expand Down
2 changes: 1 addition & 1 deletion ext/filter/filter_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 28ff4549a3e25c103a172624b8e25c6cd1912379 */
* Stub hash: 7623236b3b620e6a0e9f06615334392ab0bfce14 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_has_var, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, input_type, IS_LONG, 0)
Expand Down
5 changes: 4 additions & 1 deletion ext/mbstring/mbstring.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ function mb_strwidth(string $string, ?string $encoding = null): int {}
/** @refcount 1 */
function mb_strimwidth(string $string, int $start, int $width, string $trim_marker = "", ?string $encoding = null): string {}

/** @refcount 1 */
/**
* @return array<int|string, mixed>|string|false
* @refcount 1
*/
function mb_convert_encoding(array|string $string, string $to_encoding, array|string|null $from_encoding = null): array|string|false {}

/** @refcount 1 */
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/mbstring_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: b4709ffa2a2f993e3d280c5cd6fd731b58d4d9a6 */
* Stub hash: e553c28d2afd54f1ffcdbb0363aaa2079fabe07d */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_language, 0, 0, MAY_BE_STRING|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, language, IS_STRING, 1, "null")
Expand Down
24 changes: 20 additions & 4 deletions ext/mysqli/mysqli.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public function get_client_info(): string {}

#if defined(MYSQLI_USE_MYSQLND)
/**
* @return array<int|string, mixed>
* @tentative-return-type
* @alias mysqli_get_connection_stats
*/
Expand Down Expand Up @@ -401,18 +402,21 @@ public function fetch_fields(): array {}
public function fetch_field_direct(int $index): object|false {}

/**
* @return array<int|string, mixed>
* @tentative-return-type
* @alias mysqli_fetch_all
*/
public function fetch_all(int $mode = MYSQLI_NUM): array {}

/**
* @return array<int|string, mixed>|null|false
* @tentative-return-type
* @alias mysqli_fetch_array
*/
public function fetch_array(int $mode = MYSQLI_BOTH): array|null|false {}

/**
* @return array<int|string, mixed>|null|false
* @tentative-return-type
* @alias mysqli_fetch_assoc
*/
Expand Down Expand Up @@ -684,13 +688,22 @@ function mysqli_fetch_field_direct(mysqli_result $result, int $index): object|fa
*/
function mysqli_fetch_lengths(mysqli_result $result): array|false {}

/** @refcount 1 */
/**
* @return array<int|string, mixed>
* @refcount 1
*/
function mysqli_fetch_all(mysqli_result $result, int $mode = MYSQLI_NUM): array {}

/** @refcount 1 */
/**
* @return array<int|string, mixed>|null|false
* @refcount 1
*/
function mysqli_fetch_array(mysqli_result $result, int $mode = MYSQLI_BOTH): array|null|false {}

/** @refcount 1 */
/**
* @return array<int|string, mixed>|null|false
* @refcount 1
*/
function mysqli_fetch_assoc(mysqli_result $result): array|null|false {}

/** @refcount 1 */
Expand All @@ -713,7 +726,10 @@ function mysqli_field_tell(mysqli_result $result): int {}
function mysqli_free_result(mysqli_result $result): void {}

#if defined(MYSQLI_USE_MYSQLND)
/** @refcount 1 */
/**
* @return array<int|string, mixed>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return array<int|string, mixed>
* @return array<string, mixed>

* @refcount 1
*/
function mysqli_get_connection_stats(mysqli $mysql): array {}

/**
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/mysqli_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 11628afb5c66778bfd89890fdf182947383e59c1 */
* Stub hash: be02e12b8984705bcaae9ce16a1e90cb64af5784 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
Expand Down
1 change: 1 addition & 0 deletions ext/pcre/php_pcre.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function preg_split(string $pattern, string $subject, int $limit = -1, int $flag

function preg_quote(string $str, ?string $delimiter = null): string {}

/** @refcount 1 */
function preg_grep(string $pattern, array $array, int $flags = 0): array|false {}

function preg_last_error(): int {}
Expand Down
2 changes: 1 addition & 1 deletion ext/pcre/php_pcre_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 5d7958a9f83b19eef0bffdf631ddb47cae28733f */
* Stub hash: 62ab532c890b5421bfe8b784c803829cf71a1423 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_preg_match, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
Expand Down
5 changes: 4 additions & 1 deletion ext/pgsql/pgsql.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,10 @@ function pg_get_result(PgSql\Connection $connection): PgSql\Result|false {}
/** @refcount 1 */
function pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int {}

/** @refcount 1 */
/**
* @return array<int|string, mixed>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return array<int|string, mixed>
* @return array<int|string, int|string>

* @refcount 1
*/
function pg_get_notify(PgSql\Connection $connection, int $mode = PGSQL_ASSOC): array|false {}

function pg_get_pid(PgSql\Connection $connection): int {}
Expand Down
2 changes: 1 addition & 1 deletion ext/pgsql/pgsql_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: fef54d6edd292e005e1db070c5347a8177bc804a */
* Stub hash: 23cb6cbb27e6ecf00c5ad4d18e6e8869a33a86bf */

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pg_connect, 0, 1, PgSql\\Connection, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0)
Expand Down
1 change: 1 addition & 0 deletions ext/spl/php_spl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ function iterator_apply(Traversable $iterator, callable $callback, ?array $args

function iterator_count(Traversable $iterator): int {}

/** @refcount 1 */
function iterator_to_array(Traversable $iterator, bool $preserve_keys = true): array {}
2 changes: 1 addition & 1 deletion ext/spl/php_spl_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 20188120387b006ea0e5833ad20241b73d2e2327 */
* Stub hash: 7359e9e5aa07c00d0e0be2642f11c1131a17e61e */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_implements, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_INFO(0, object_or_class)
Expand Down