Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class NullPointer {
- /**
- * @var DateTime|null
- */
- protected ?DateTime $date = null;
- public function getDateFormat(?DateTime $input): string
- {
- // This is inspected properly
- $input->format('');
- // This is completely ignored
- return $this->date->format('');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment