psalm icon indicating copy to clipboard operation
psalm copied to clipboard

Fix DateTimeImmutable::sub() to not return false

Open AndrolGenhald opened this issue 1 year ago • 1 comments

@Ocramius The ->sub() issue is separate from this, this issue is only for ->modify(), but I do believe ->sub() was incorrect in your PR, here's an example for that special case you found: https://3v4l.org/TIWRB

It indeed gives a warning and returns a clone, so there's no false return.

Also, go get some sleep :stuck_out_tongue:

Originally posted by @AndrolGenhald in https://github.com/vimeo/psalm/issues/8454#issuecomment-1238386327

AndrolGenhald avatar Sep 14 '22 18:09 AndrolGenhald

Hey @AndrolGenhald, can you reproduce the issue on https://psalm.dev ?

psalm-github-bot[bot] avatar Sep 14 '22 18:09 psalm-github-bot[bot]