This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix timezone conversion on strings
When setting a default application timezone, and a display timezone:
```php
date_default_timezone_set('UTC');
$twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris');
```
Date objects get converted, but strings don't. See #4545.
For most other paths in `convertDate`, the dateTime object is initialized, and afterwards the timezone gets set. For strings, the timezone is passed as a constructor argument before having the timezone set again, losing its converting behaviour. This makes the convertDate method work identical for DateTime objects as strings. This different behaviour was already spotted in #3568.
Fixes#4545#3568#2819
Commits
-------
f69531fa00 Fix timezone conversion on strings
This PR was merged into the 3.x branch.
Discussion
----------
Fix wrong type for cycle position
It also accepts 0, which is not a positive int.
Commits
-------
c78499bda9 Fix wrong type for cycle position
This PR was merged into the 3.x branch.
Discussion
----------
Add type for join method
Looking at the code, this method is very forgiving in what it accepts.
This helps PHPStan to not complain when something other than an array is passed.
Did I miss other types?
/cc `@stof`
Commits
-------
226f0ff0dd Add type for join method
* 3.14.x:
Improve detection of recursion
Fix recursion when arrays contain self-references in sandboxed mode
Fix code
Prepare the 3.11.2 release
Update CHANGELOG
Sandbox ArrayAccess and do sandbox checks before isset() checks
Fix sandbox handling for __toString()
Prepare the 3.14.1 release
Update CHANGELOG
Sandbox ArrayAccess and do sandbox checks before isset() checks
Fix sandbox handling for __toString()
Prepare the 3.11.1 release
Fix a security issue when an included sandboxed template has been loaded before without the sandbox context
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Trigger deprecations when using "??" and "not" without explicit parentheses when precedence will change in 4.0
Closes#3387Closes#3642
Commits
-------
2081b1ff74 Deprecate using the not unary operator without parenthesis
f4aacafd78 Deprecate using ?? without explicit parentheses
This PR was merged into the 3.x branch.
Discussion
----------
Add support for accessing class constants with the dot operator
This PR allows accessing class constants from objects: `{{ foo.SOME_CONSTANT }}`. This should nicely replace the `constant()` function when an object is at hand, and is actually needed to make the `enum` function work in #4352.
Commits
-------
1ea0452323 Add support for accessing class constants with the dot operator
This PR was merged into the 3.x branch.
Discussion
----------
Fix getting a property on an object casted to an array
Closes#3371
Commits
-------
7d5269e100 Fix getting a property on an object casted to an array