Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1e0c10f

Browse files
staabmondrejmirtes
authored andcommitted
Added PHP_BUILD_DATE type (PHP 8.5+)
1 parent 3435c3b commit 1e0c10f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

‎src/Analyser/ConstantResolver.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
159159

160160
return $this->createInteger($minVersion, $maxVersion);
161161
}
162+
// added in PHP 8.5
163+
if ($resolvedConstantName === 'PHP_BUILD_DATE') {
164+
return new IntersectionType([
165+
new StringType(),
166+
new AccessoryNonFalsyStringType(),
167+
]);
168+
}
162169
if ($resolvedConstantName === 'PHP_ZTS') {
163170
return new UnionType([
164171
new ConstantIntegerType(0),
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
use function PHPStan\Testing\assertType;
4+
5+
assertType('non-falsy-string', PHP_BUILD_DATE);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /