Skip to editor
Psalm
Docs
Playground
Plugins
Blog
Paid support
Share
Fix issues
Show original
PHP
Settings
<?php /** * @psalm-immutable */ class Foo { private ?DateTimeImmutable $date = null; public function getDate(): ?DateTimeImmutable { return $this->date; } } class Bar { public ?DateTimeImmutable $date; public ?string $timezone; public function __construct(Foo $foo, ?DateTimeImmutable $date) { if (is_null($foo->getDate())) { $this->date = $date; $this->timezone = !is_null($date) ? $date->getTimezone()->getName() : null; } else { $this->date = $foo->getDate(); /** @psalm-trace $this->date */; $this->timezone = $foo->getDate()->getTimezone()->getName(); } } }
Issues
Types
idle
Saved Jun 22 2021 12:25 UTC
⌘/Ctrl+Enter
run
⌘/Ctrl+S
share
F8
/
⇧F8
next/prev issue