Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions stubs/core.stub
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ function abs($num) {}
*/
function get_defined_constants(bool $categorize = false): array {}

/**
* @return ($associative is false ? list<string>|false : array<int|string, string|list<string>>|false)
*/
function get_headers(string $url, bool $associative = false, ?resource $context = null): array|false {}

/**
* @param array<string> $long_options
* @param mixed $rest_index
Expand Down
9 changes: 9 additions & 0 deletions tests/PHPStan/Analyser/nsrt/get_headers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types = 1);

namespace Bug13835;

use function PHPStan\Testing\assertType;

assertType('list<string>|false', get_headers('http://example.com'));
assertType('array<int|string, list<string>>|string|false', get_headers('http://example.com', true));
assertType('list<string>|false', get_headers('http://example.com', false));
Loading