Skip to content

Commit 0035f7d

Browse files
VincentLangletondrejmirtes
authored andcommitted
Fix extract signature
1 parent bd6eb76 commit 0035f7d

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

resources/functionMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@
20982098
'explode' => ['list<string>|false', 'separator'=>'string', 'str'=>'string', 'limit='=>'int'],
20992099
'expm1' => ['float', 'number'=>'float'],
21002100
'extension_loaded' => ['bool', 'extension_name'=>'string'],
2101-
'extract' => ['0|positive-int', 'array'=>'array', 'flags='=>'EXTR_OVERWRITE|EXTR_SKIP|EXTR_PREFIX_SAME|EXTR_PREFIX_ALL|EXTR_PREFIX_INVALID|EXTR_IF_EXISTS|EXTR_PREFIX_IF_EXISTS|EXTR_REFS', 'prefix='=>'string|null'],
2101+
'extract' => ['0|positive-int', 'array'=>'array', 'flags='=>'int-mask<EXTR_OVERWRITE|EXTR_SKIP|EXTR_PREFIX_SAME|EXTR_PREFIX_ALL|EXTR_PREFIX_INVALID|EXTR_IF_EXISTS|EXTR_PREFIX_IF_EXISTS|EXTR_REFS>', 'prefix='=>'string|null'],
21022102
'ezmlm_hash' => ['int', 'addr'=>'string'],
21032103
'fam_cancel_monitor' => ['bool', 'fam'=>'resource', 'fam_monitor'=>'resource'],
21042104
'fam_close' => ['void', 'fam'=>'resource'],

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,6 +2324,11 @@ public function testBug13197(): void
23242324
$this->analyse([__DIR__ . '/../../Analyser/nsrt/bug-13197.php'], []);
23252325
}
23262326

2327+
public function testBug13434(): void
2328+
{
2329+
$this->analyse([__DIR__ . '/data/bug-13434.php'], []);
2330+
}
2331+
23272332
public function testBug13556(): void
23282333
{
23292334
$this->checkExplicitMixed = true;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Bug13434;
4+
5+
extract( $_GET, EXTR_REFS | EXTR_PREFIX_ALL );
6+
extract( $_GET, EXTR_REFS | EXTR_SKIP );
7+
8+
9+
$ftp = ftp_connect('ftp.example.com');
10+
assert($ftp != false);
11+
ftp_set_option($ftp, FTP_TIMEOUT_SEC | FTP_AUTOSEEK | 1337, true);

0 commit comments

Comments
 (0)