Psalm: Potentially invalid "ImpureArgument" error thrown

Created on 7 Mar 2020  路  3Comments  路  Source: vimeo/psalm

Most helpful comment

DateTimeZone looks pretty immutable to me - unless anyone has any objections I鈥檒l treat it the same as DateTimeImmutable

All 3 comments

I found these snippets:


https://psalm.dev/r/4a9515aee0

<?php
new DateTimeImmutable('now', new DateTimeZone('UTC'));
Psalm output (using commit 8926f1d):

ERROR: ImpureArgument - 2:30 - Cannot pass mutable value to DateTimeImmutable::__construct

DateTimeZone looks pretty immutable to me - unless anyone has any objections I鈥檒l treat it the same as DateTimeImmutable

@muglug

That would be great!

馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vudaltsov picture vudaltsov  路  3Comments

zerkms picture zerkms  路  3Comments

Ocramius picture Ocramius  路  3Comments

muglug picture muglug  路  3Comments

albe picture albe  路  3Comments