summaryrefslogtreecommitdiff
path: root/tests/examplefiles/test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examplefiles/test.php')
-rw-r--r--tests/examplefiles/test.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/examplefiles/test.php b/tests/examplefiles/test.php
index 2ce4023e..e8efdc6a 100644
--- a/tests/examplefiles/test.php
+++ b/tests/examplefiles/test.php
@@ -505,11 +505,40 @@ function &byref() {
return $x;
}
+// Test highlighting of magic methods and variables
+class MagicClass {
+ public $magic_str;
+ public $ordinary_str;
+
+ public function __construct($some_var) {
+ $this->magic_str = __FILE__;
+ $this->ordinary_str = $some_var;
+ }
+
+ public function __toString() {
+ return $this->magic_str;
+ }
+
+ public function nonMagic() {
+ return $this->ordinary_str;
+ }
+}
+
+$magic = new MagicClass(__DIR__);
+__toString();
+$magic->nonMagic();
+$magic->__toString();
+
echo <<<EOF
Test the heredocs...
EOF;
+echo <<<"some_delimiter"
+more heredoc testing
+continues on this line
+some_delimiter;
+
?>