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.
1 parent d7eaeea commit 5b5f565Copy full SHA for 5b5f565
2 files changed
CHANGELOG
@@ -1,6 +1,6 @@
1
* 1.40.2 (2019-XX-XX)
2
3
- * n/a
+ * optimized context access on PHP 7.4
4
5
* 1.40.1 (2019-04-29)
6
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