aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights/php/variables.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/query/highlights/php/variables.php')
-rw-r--r--tests/query/highlights/php/variables.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/query/highlights/php/variables.php b/tests/query/highlights/php/variables.php
new file mode 100644
index 000000000..6a466357c
--- /dev/null
+++ b/tests/query/highlights/php/variables.php
@@ -0,0 +1,28 @@
+<?php
+
+class A {
+ public function foo(self $a): self {
+// ^ @variable
+ new self();
+// ^^^^ @constructor
+ new static();
+// ^^^^^^ @constructor
+ new parent();
+// ^^^^^^ @constructor
+ $this->foo();
+// ^^^^ @variable.builtin
+// ^^ @operator
+// ^^^ @function.method.call
+ self::foo();
+// ^^^^ @variable.builtin
+// ^^^ @function.call
+ static::foo();
+// ^^^^^^ @variable.builtin
+ parent::foo();
+// ^^^^^^ @variable.builtin
+ $this->foo;
+// ^^^ @variable.member
+ $this->foo(a: 5);
+// ^ @variable.parameter
+ }
+}