We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 242f09a commit 90d7eddCopy full SHA for 90d7edd
src/Node/Printer/ExprPrinter.php
@@ -20,6 +20,11 @@ public function __construct(private Printer $printer)
20
21
public function printExpr(Expr $expr): string
22
{
23
+ // perf optimize for the most common path
24
+ if ($expr instanceof Expr\Variable && !$expr->name instanceof Expr) {
25
+ return '$' . $expr->name;
26
+ }
27
+
28
/** @var string|null $exprString */
29
$exprString = $expr->getAttribute(self::ATTRIBUTE_CACHE_KEY);
30
if ($exprString === null) {
0 commit comments