minor #2348 remove condition on PHP version (MatTheCat)

This PR was merged into the 2.x branch.

Discussion
----------

remove condition on PHP version

Twig now requires PHP >= 7 so there is no need to check for prior version.

Commits
-------

df185584 remove condition on PHP version
This commit is contained in:
Fabien Potencier
2017-01-10 07:05:50 -08:00
+5 -16
View File
@@ -44,22 +44,11 @@ class Twig_Node_Expression_Name extends Twig_Node_Expression
;
} else {
if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) {
if (PHP_VERSION_ID >= 70000) {
// use PHP 7 null coalescing operator
$compiler
->raw('($context[')
->string($name)
->raw('] ?? null)')
;
} else {
$compiler
->raw('(isset($context[')
->string($name)
->raw(']) ? $context[')
->string($name)
->raw('] : null)')
;
}
$compiler
->raw('($context[')
->string($name)
->raw('] ?? null)')
;
} else {
$compiler
->raw('(isset($context[')