()
| 2527 | class UnknownMemberDemo |
| 2528 | { |
| 2529 | public function demo(): void |
| 2530 | { |
| 2531 | $user = new User('test', 'test@example.com'); |
| 2532 | |
| 2533 | // These resolve fine — no warning: |
| 2534 | $user->getEmail(); |
| 2535 | $user->getName(); |
| 2536 | |
| 2537 | // Try: uncomment the next line to see the warning: |
| 2538 | $user->nonexistentMethod(); |
| 2539 | |
| 2540 | // Static access — unknown constant gets a warning: |
| 2541 | User::MISSING_CONST; |
| 2542 | } |
| 2543 | } |
| 2544 | |
| 2545 |