-
Notifications
You must be signed in to change notification settings - Fork 541
Allow getenv(null) for PHP > 8 #4007
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
Changes from 5 commits
4942824
a0b4504
9c05317
ebe11b8
6bc4f2c
647fc09
b4d3410
7b176f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,12 @@ private static function findTestFiles(): iterable | |
yield __DIR__ . '/data/explode-php80.php'; | ||
} | ||
|
||
if (PHP_VERSION_ID < 80000) { | ||
yield __DIR__ . '/data/getenv-php74.php'; | ||
} else { | ||
yield __DIR__ . '/data/getenv-php80.php'; | ||
|
||
} | ||
|
||
if (PHP_VERSION_ID >= 80000) { | ||
yield __DIR__ . '/../Reflection/data/unionTypes.php'; | ||
yield __DIR__ . '/../Reflection/data/mixedType.php'; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace GetenvPHP74; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
class Foo | ||
{ | ||
|
||
public function test() | ||
{ | ||
assertType('string|false', getenv(null)); | ||
assertType('array<string, string>', getenv()); | ||
assertType('string|false', getenv('foo')); | ||
} | ||
VincentLanglet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace GetenvPHP80; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
class Foo | ||
{ | ||
|
||
public function test() | ||
{ | ||
assertType('array<string, string>', getenv(null)); | ||
assertType('array<string, string>', getenv()); | ||
assertType('string|false', getenv('foo')); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Bug13065; | ||
|
||
class Foo | ||
{ | ||
|
||
public function test() | ||
{ | ||
getenv(null); | ||
getenv(); | ||
getenv('foo'); | ||
} | ||
|
||
} |
Uh oh!
There was an error while loading. Please reload this page.