We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d03684c + 7395b7a commit 804cf65Copy full SHA for 804cf65
2 files changed
CHANGELOG
@@ -224,7 +224,7 @@
224
225
* 1.40.2 (2019-XX-XX)
226
227
- * n/a
+ * optimized context access on PHP 7.4
228
229
* 1.40.1 (2019-04-29)
230
src/Node/Expression/NameExpression.php
@@ -36,13 +36,20 @@ public function compile(Compiler $compiler)
36
if ($this->getAttribute('is_defined_test')) {
37
if ($this->isSpecial()) {
38
$compiler->repr(true);
39
+ } elseif (\PHP_VERSION_ID >= 700400) {
40
+ $compiler
41
+ ->raw('array_key_exists(')
42
+ ->string($name)
43
+ ->raw(', $context)')
44
+ ;
45
} else {
46
$compiler
47
->raw('(isset($context[')
48
->string($name)
49
->raw(']) || array_key_exists(')
50
- ->raw(', $context))');
51
+ ->raw(', $context))')
52
53
}
54
} elseif ($this->isSpecial()) {
55
$compiler->raw($this->specialVars[$name]);
0 commit comments