-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix internal error for dynamic properties defined on interface on PHP…
… 8.2
- Loading branch information
1 parent
0476903
commit 4025209
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Bug8537; | ||
|
||
/** | ||
* @property int $x | ||
*/ | ||
interface SampleInterface | ||
{ | ||
} | ||
|
||
class Sample implements SampleInterface | ||
{ | ||
/** @param array<string,mixed> $data */ | ||
public function __construct(private array $data = []) | ||
{ | ||
} | ||
|
||
public function __set(string $key, mixed $value): void | ||
{ | ||
$this->data[$key] = $value; | ||
} | ||
|
||
public function __get(string $key): mixed | ||
{ | ||
return $this->data[$key] ?? null; | ||
} | ||
|
||
public function __isset(string $key): bool | ||
{ | ||
return array_key_exists($key, $this->data); | ||
} | ||
} | ||
|
||
function (): void { | ||
$test = new Sample(); | ||
$test->x = 3; | ||
echo $test->x; | ||
}; |