Fix constant() behavior when used with ??

This commit is contained in:
Fabien Potencier
2025-01-14 17:38:45 +01:00
parent 65fa0c67f8
commit a998723b70
3 changed files with 10 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
# 3.19.0 (2025-XX-XX)
* Fix `constant()` behavior when used with `??`
* Add the `invoke` filter
* Make `{}` optional for the `types` tag
* Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
+7
View File
@@ -105,6 +105,13 @@ class Node implements \Countable, \IteratorAggregate
return $repr;
}
public function __clone()
{
foreach ($this->nodes as $name => $node) {
$this->nodes[$name] = clone $node;
}
}
/**
* @return void
*/
+2
View File
@@ -4,9 +4,11 @@
{{ constant('DATE_W3C') == expect ? 'true' : 'false' }}
{{ constant('ARRAY_AS_PROPS', object) }}
{{ constant('class', object) }}
{{ constant('ARRAY_AS_PROPS', object) ?? 'KO' }}
--DATA--
return ['expect' => DATE_W3C, 'object' => new \ArrayObject(['hi'])]
--EXPECT--
true
2
ArrayObject
2