Skip to content

Commit 304c35e

Browse files
committed
Update bug-12373.php
1 parent 7a94378 commit 304c35e

1 file changed

Lines changed: 19 additions & 18 deletions

File tree

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
<?php // lint >= 8.0
22

3+
declare(strict_types=1);
4+
35
namespace Bug12373;
46

5-
function test(): void
7+
class HelloWorld
68
{
7-
$foo = [];
9+
public function sayHello(int $id): void
10+
{
11+
$foo = [];
812

9-
[$always_a, $always_b, $always_c] = [rand(0, 1), rand(0, 1), rand(0, 1)];
10-
if (rand(0, 1)) {
11-
[$maybe_a, $maybe_b, $maybe_c] = [rand(0, 1), rand(0, 1), rand(0, 1)];
12-
$flag = true;
13-
} else {
14-
$flag = false;
15-
}
13+
if ($id)
14+
{
15+
$foo = 'foo';
16+
}
17+
else
18+
{
19+
$value = 'my value';
20+
}
1621

17-
if ($flag && $always_a !== $maybe_a) {
18-
$foo[] = 'first';
19-
}
20-
21-
if (($always_a && !$always_b) || ($flag && $maybe_a && !$maybe_b)) {
22-
$foo[] = 'second';
23-
}
22+
$foo = "foo";
2423

25-
if (($always_a && !$always_c) || ($flag && $maybe_a && !$maybe_c)) {
26-
$foo[] = 'third';
24+
if (!$id)
25+
{
26+
echo 'value: ' . $value;
27+
}
2728
}
2829
}

0 commit comments

Comments
 (0)